From 2a8ecd932ecfb06d05afa97f8db9e1017ece0bc6 Mon Sep 17 00:00:00 2001 From: Gabriel Silva Date: Sat, 11 Feb 2023 17:16:27 -0300 Subject: [PATCH] Trocando o removeItem por clear - Front-end. - 3 --- front-end/src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front-end/src/App.tsx b/front-end/src/App.tsx index b40b238..ba8d0a4 100644 --- a/front-end/src/App.tsx +++ b/front-end/src/App.tsx @@ -73,6 +73,10 @@ export function App () { }, }); + window.onload = () => { + localStorage.removeItem("success"); + }; + useEffect(() => { const token = localStorage.getItem("token"); const success = localStorage.getItem("success"); @@ -90,10 +94,6 @@ export function App () { toastId: `${id}:success-s` }); }; - - window.onload = () => { - localStorage.clear(); - }; }, [signInFunction.isSuccess, userIsAuthenticated]); const todosCompleteApi =