Skip to content

Commit

Permalink
DiscordRPC: Remove unnecessary update
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ckoates committed Sep 16, 2024
1 parent 7a3ad06 commit d998d04
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/DiscordRPC/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ const unloadTime = intercept("playbackControls/TIME_UPDATE", ([newTime]) => {
time = newTime;
});

const unloadSeek = intercept("playbackControls/SEEK", ([newTime]) => {
if (typeof newTime === "number") update({ time: newTime });
});

const unloadPlay = intercept(
"playbackControls/SET_PLAYBACK_STATE",
([state]) => {
if (state === "PLAYING") update({ paused: false });
if (paused && state === "PLAYING") update({ paused: false });
}
);

Expand All @@ -122,6 +126,7 @@ update({
export const onUnload = () => {
unloadTransition();
unloadTime();
unloadSeek();
unloadPlay();
unloadPause();
window.electron.ipcRenderer
Expand Down

0 comments on commit d998d04

Please sign in to comment.