diff --git a/src-tauri/yaak-license/index.ts b/src-tauri/yaak-license/index.ts index aedf27c6..39f55308 100644 --- a/src-tauri/yaak-license/index.ts +++ b/src-tauri/yaak-license/index.ts @@ -18,7 +18,7 @@ export function useLicense() { useEffect(() => { listen('license-activated', () => { queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }).catch(console.error); - }).then(console.error); + }).catch(console.error); }, []); const CHECK_QUERY_KEY = ['license.check']; diff --git a/src-web/hooks/useSyncWorkspaceChildModels.ts b/src-web/hooks/useSyncWorkspaceChildModels.ts index 9102966a..1ab67002 100644 --- a/src-web/hooks/useSyncWorkspaceChildModels.ts +++ b/src-web/hooks/useSyncWorkspaceChildModels.ts @@ -13,8 +13,9 @@ import { keyValuesAtom } from './useKeyValue'; export function useSyncWorkspaceChildModels() { useEffect(() => { - jotaiStore.sub(activeWorkspaceIdAtom, sync); + const unsub = jotaiStore.sub(activeWorkspaceIdAtom, sync); sync().catch(console.error); + return unsub; }, []); }