mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
prevent change of media state with empty queue
This commit is contained in:
parent
ba531505af
commit
0d03b66fe5
5 changed files with 26 additions and 11 deletions
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from 'react-icons/ri';
|
||||
import { Song } from '/@/renderer/api/types';
|
||||
import { usePlayerControls, useQueueControls } from '/@/renderer/store';
|
||||
import { PlaybackType, TableType } from '/@/renderer/types';
|
||||
import { PlaybackType, PlayerStatus, TableType } from '/@/renderer/types';
|
||||
import { usePlaybackType } from '/@/renderer/store/settings.store';
|
||||
import { usePlayerStore, useSetCurrentTime } from '../../../store/player.store';
|
||||
import { TableConfigDropdown } from '/@/renderer/components/virtual-table';
|
||||
|
|
@ -91,7 +91,7 @@ export const PlayQueueListControls = ({ type, tableRef }: PlayQueueListOptionsPr
|
|||
mpvPlayer!.pause();
|
||||
}
|
||||
|
||||
remote?.updateSong({ song: undefined });
|
||||
remote?.updateSong({ song: undefined, status: PlayerStatus.PAUSED });
|
||||
|
||||
setCurrentTime(0);
|
||||
pause();
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ export const useCenterControls = (args: { playersRef: any }) => {
|
|||
]);
|
||||
|
||||
const handlePlayPause = useCallback(() => {
|
||||
if (queue) {
|
||||
if (queue.length > 0) {
|
||||
if (playerStatus === PlayerStatus.PAUSED) {
|
||||
return handlePlay();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue