Skip to content

Commit

Permalink
fix: handleResize
Browse files Browse the repository at this point in the history
  • Loading branch information
ircfspace committed Jan 2, 2025
1 parent 96e7751 commit f38af1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/pages/Landing/useLanding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const useLanding = () => {
setTimeout(() => setDrawerIsOpen(false), 300);
}
};
const resizeListener = debounce(handleResize, 500);
handleResize();

ipcRenderer.on('guide-toast', (message: any) => {
if (message === 'error_port_restart') {
Expand Down Expand Up @@ -241,7 +241,7 @@ const useLanding = () => {
}
}, 2000);

window.addEventListener('resize', resizeListener);
window.addEventListener('resize', handleResize);
window.addEventListener('online', handleOnlineStatusChange);
window.addEventListener('offline', handleOnlineStatusChange);
handleOnlineStatusChange();
Expand All @@ -251,7 +251,7 @@ const useLanding = () => {
checkForUpdates();

return () => {
window.removeEventListener('resize', resizeListener);
window.removeEventListener('resize', handleResize);
window.removeEventListener('online', handleOnlineStatusChange);
window.removeEventListener('offline', handleOnlineStatusChange);
};
Expand Down

0 comments on commit f38af1c

Please sign in to comment.