Skip to content

Commit

Permalink
DiscordRPC: Listen to time update instead of seek
Browse files Browse the repository at this point in the history
- Time updates don't trigger updates. Instead, they just update the time variable, which is used by other updates.
- `SET_PLAYBACK_STATE` fires when seeking anyway, so RPC is still updated.
  • Loading branch information
n1ckoates committed Sep 16, 2024
1 parent 8076b58 commit 7a3ad06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/DiscordRPC/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ const unloadTransition = intercept(
}
);

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

const unloadPlay = intercept(
Expand All @@ -121,7 +121,7 @@ update({

export const onUnload = () => {
unloadTransition();
unloadSeek();
unloadTime();
unloadPlay();
unloadPause();
window.electron.ipcRenderer
Expand Down

0 comments on commit 7a3ad06

Please sign in to comment.