From 1dd1b6fbdb82f0aca5160c135da54e35cc76627c Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 24 Sep 2024 12:09:01 +0530 Subject: [PATCH] fix: pass null if not found --- src/context/auth.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/auth.tsx b/src/context/auth.tsx index 83c75b57..98fa4b49 100644 --- a/src/context/auth.tsx +++ b/src/context/auth.tsx @@ -53,7 +53,7 @@ const Provider = ({ children }: ProviderProps) => { useEffect(() => { dispatch({ type: 'LOGIN', - payload: JSON.parse(window.localStorage.getItem('user')), + payload: JSON.parse(window.localStorage.getItem('user') || 'null'), }); }, []);