From f0850146be9aff64e76b377b2981f4cfc0792dce Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sun, 5 Jan 2025 08:05:15 +0100 Subject: [PATCH] Updates --- components/lib/hooks/useLocalUser.tsx | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 components/lib/hooks/useLocalUser.tsx diff --git a/components/lib/hooks/useLocalUser.tsx b/components/lib/hooks/useLocalUser.tsx deleted file mode 100644 index f88441b..0000000 --- a/components/lib/hooks/useLocalUser.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { LocalStorageDict } from "@/dict/local-storage-dict"; -import { DATASQUIREL_LoggedInUser } from "@moduletrace/datasquirel/package-shared/types"; -import React from "react"; - -export default function useLocalUser() { - const [user, setUser] = React.useState< - DATASQUIREL_LoggedInUser | null | undefined - >(undefined); - - React.useEffect(() => { - try { - const localUserJSON = localStorage.getItem( - LocalStorageDict["User"] - ); - if (localUserJSON) { - const localUser = JSON.parse(localUserJSON); - setUser(localUser); - } - } catch (error) { - setUser(null); - } - }, []); - - return { user }; -}