Skip to content

Commit

Permalink
actually test and fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Life committed Dec 10, 2023
1 parent 2b3e311 commit 713c1ea
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions dashboard/src/pages/servers/[id]/player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,24 @@ const Player: NextPageWithLayout = () => {
});
};

useEffect(() => {
sharedStateMount(sharedState);
seekerMount();

playerSocket.mount(serverId as string, {
mountHandler: {
close: handleSocketClose,
},
eventHandler: socketEventHandlers,
});

return () => {
sharedStateUnmount(sharedState);
seekerUnmount();
playerSocket.unmount(serverId as string);
};
}, []);

const handleNavbarToggle = () => {
if (!sharedState.setNavbarShow) return;
if (!sharedState.navbarAbsolute) {
Expand Down Expand Up @@ -452,26 +470,12 @@ const Player: NextPageWithLayout = () => {
};

useEffect(() => {
sharedStateMount(sharedState);
seekerMount();

playerSocket.mount(serverId as string, {
mountHandler: {
close: handleSocketClose,
},
eventHandler: socketEventHandlers,
});

registerAllSrct();

return () => {
sharedStateUnmount(sharedState);
seekerUnmount();
playerSocket.unmount(serverId as string);

unregisterAllSrct();
};
}, []);
}, [registerAllSrct, unregisterAllSrct]);

const mainImg = !playing?.thumbnail?.length
? SampleThumb.src
Expand Down

0 comments on commit 713c1ea

Please sign in to comment.