From 9e2d983593941f398e572f7d7b3835ed790d1d9d Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 6 Nov 2024 11:55:43 -0500 Subject: [PATCH] delay logout count --- packages/app-utils/src/components/AppBootstrap.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app-utils/src/components/AppBootstrap.tsx b/packages/app-utils/src/components/AppBootstrap.tsx index 20b8a4a2e5..b5644baa45 100644 --- a/packages/app-utils/src/components/AppBootstrap.tsx +++ b/packages/app-utils/src/components/AppBootstrap.tsx @@ -51,7 +51,9 @@ export function AppBootstrap({ const [logoutCount, setLogoutCount] = useState(0); const onLogin = useCallback(() => undefined, []); const onLogout = useCallback(() => { - setLogoutCount(value => value + 1); + requestAnimationFrame(() => { + setLogoutCount(value => value + 1); + }); }, []); useBroadcastLoginListener(onLogin, onLogout); return (