From 1de0fe9ab28fec1de968a1a230289a2a67bc3c05 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 9 Oct 2024 14:17:35 +0530 Subject: [PATCH] Mark the problematic ones --- web/apps/photos/src/pages/_app.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx index 5c1f7fb2fe..b50afc4340 100644 --- a/web/apps/photos/src/pages/_app.tsx +++ b/web/apps/photos/src/pages/_app.tsx @@ -230,7 +230,10 @@ export default function App({ Component, pageProps }: AppProps) { }, 100); }; - const closeMessageDialog = () => setMessageDialogView(false); + const closeMessageDialog = useCallback( + () => setMessageDialogView(false), + [], + ); const closeDialogBoxV2 = () => setDialogBoxV2View(false); // Use `onGenericError` instead. @@ -256,14 +259,14 @@ export default function App({ Component, pageProps }: AppProps) { [setDialogBoxAttributesV2], ); - const logout = () => { + const logout = useCallback(() => { void photosLogout().then(() => router.push("/")); - }; + }, [router]); const appContext = { showNavBar, - startLoading, - finishLoading, + startLoading, // <- changes on each render (TODO Fix) + finishLoading, // <- changes on each render closeMessageDialog, setDialogMessage, watchFolderView, @@ -277,7 +280,7 @@ export default function App({ Component, pageProps }: AppProps) { onGenericError, setDialogBoxAttributesV2, mapEnabled, - updateMapEnabled, + updateMapEnabled, // <- changes on each render isCFProxyDisabled, setIsCFProxyDisabled, logout,