From 16cf7bfc56d8ff373169b9f6745a286e3bd436e3 Mon Sep 17 00:00:00 2001 From: Tyler Date: Wed, 15 Jan 2025 19:09:50 -0500 Subject: [PATCH] fix-online-handler --- src/hooks/useInitializePage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useInitializePage.ts b/src/hooks/useInitializePage.ts index 6b5523315..17bd90713 100644 --- a/src/hooks/useInitializePage.ts +++ b/src/hooks/useInitializePage.ts @@ -71,9 +71,9 @@ export const useInitializePage = () => { IndexerWebsocketManager.getActiveResources().forEach((r) => r.restart()); logAbacusTsInfo('useInitializePage', 'restarting because network status change'); }; - document.addEventListener('online', handleOnline); + window.addEventListener('online', handleOnline); return () => { - document.removeEventListener('online', handleOnline); + window.removeEventListener('online', handleOnline); }; }, [localStorageNetwork]); };