Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Enable "stop" button when paused (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Apr 10, 2022
1 parent 84accf6 commit ec62245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/player/PlayerBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ const PlayerBar = () => {
icon="stop"
size="lg"
fixedWidth
disabled={playQueue.entry.length === 0 || player.status !== 'PLAYING'}
disabled={playQueue.entry.length === 0}
onClick={handleStop}
onKeyDown={(e: any) => {
if (e.key === ' ' || e.key === 'Enter') {
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/usePlayerControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const usePlayerControls = (
playersRef.current.player2.audioEl.current.currentTime = 0;
playersRef.current.player1.audioEl.current.pause();
playersRef.current.player1.audioEl.current.currentTime = 0;
setCurrentTime(0);

ipcRenderer.send('playpause', {
status: 'PAUSED',
Expand All @@ -175,7 +176,7 @@ const usePlayerControls = (
setTimeout(() => {
dispatch(setStatus('PAUSED'));
}, 250);
}, [dispatch, playersRef]);
}, [dispatch, playersRef, setCurrentTime]);

const handleSeekBackward = useCallback(() => {
const seekBackwardInterval = Number(settings.getSync('seekBackwardInterval'));
Expand Down

0 comments on commit ec62245

Please sign in to comment.