Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Make 'pause after song' work
Browse files Browse the repository at this point in the history
  • Loading branch information
Glench authored and Bertaz committed Feb 12, 2020
1 parent f18e6c9 commit 8f2854a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ window.wait(() => {
GPM.on('change:track', () => {
if (pauseAfter === PAUSE_NEXT) {
GPM.playback.playPause();
// because change:track is sometimes triggered twice in a row, it's good to set pauseAfter here
// so a track doesn't get playPaused() then immediately playPaused() again.
pauseAfter = DONT_PAUSE;
Emitter.fireAtGoogle('pauseAfter:hide', null);
}
if (pauseAfter === PAUSE_AFTER) {
Expand All @@ -26,7 +29,7 @@ Emitter.on('pauseAfter:show', () => {
return false;
},
(toast) => {
pauseAfter = PAUSE_AFTER;
pauseAfter = PAUSE_NEXT;
Emitter.on('pauseAfter:hide', () => {
pauseAfter = DONT_PAUSE;
toast.hide();
Expand Down

0 comments on commit 8f2854a

Please sign in to comment.