diff --git a/front/src/primitives/utils/hover.ts b/front/src/primitives/utils/hover.ts index 2dd49b83..469826e4 100644 --- a/front/src/primitives/utils/hover.ts +++ b/front/src/primitives/utils/hover.ts @@ -7,7 +7,6 @@ let hoverTimeout: NodeJS.Timeout | number; export const useMobileHover = () => { if (Platform.OS !== "web") return; - // biome-ignore lint/correctness/useHookAtTopLevel: const condition useEffect(() => { const enableHover = () => { if (preventHover) return; diff --git a/front/src/providers/account-provider.tsx b/front/src/providers/account-provider.tsx index 6fff812a..4e540851 100644 --- a/front/src/providers/account-provider.tsx +++ b/front/src/providers/account-provider.tsx @@ -31,7 +31,6 @@ export const AccountProvider = ({ children }: { children: ReactNode }) => { const router = useRouter(); if (Platform.OS !== "web") { - // biome-ignore lint/correctness/useHookAtTopLevel: static useEffect(() => { if (!ret.apiUrl) { setTimeout(() => { @@ -76,12 +75,12 @@ export const AccountProvider = ({ children }: { children: ReactNode }) => { updateAccount(nUser.id, nUser); }, [user, userIsSuccess, userIsPlaceholder]); - const selectedId = ret.selectedAccount?.id; + const curId = selectedRef.current?.id; useEffect(() => { - selectedId; + console.log("Selected user changed, new id: ", curId); // if the user change account (or connect/disconnect), reset query cache. queryClient.resetQueries(); - }, [selectedId, queryClient]); + }, [curId, queryClient]); return ( {children} diff --git a/front/src/providers/settings.ts b/front/src/providers/settings.ts index 52cda316..da004b72 100644 --- a/front/src/providers/settings.ts +++ b/front/src/providers/settings.ts @@ -50,7 +50,7 @@ export const useStoreValue = (key: string, parser: T) => { return readCookie(key, parser); } // biome-ignore lint/correctness/useHookAtTopLevel: constant - const [val] = useMMKVString(key); + const [val] = useMMKVString(key, storage); if (val === undefined) return val; return parser.parse(JSON.parse(val)) as z.infer; }; @@ -71,7 +71,6 @@ export const readValue = (key: string, parser: T) => { export const useLocalSetting = (setting: string, def: T) => { if (Platform.OS === "web" && typeof window === "undefined") return [def as T, null!] as const; - // biome-ignore lint/correctness/useHookAtTopLevel: ssr const [val, setter] = useMMKVString(`settings.${setting}`, storage); return [(val ?? def) as T, setter] as const; };