fix query response cant be undefined

This commit is contained in:
Danel Kungla
2025-09-04 10:59:34 +03:00
parent 5176ecdddc
commit 152ec5f36b
2 changed files with 2 additions and 4 deletions

View File

@@ -4,12 +4,10 @@ import type { User } from '@supabase/supabase-js';
import { PersonalAccountDropdown } from '@kit/accounts/personal-account-dropdown';
import { ApplicationRole } from '@kit/accounts/types/accounts';
import { featureFlagsConfig, pathsConfig } from '@kit/shared/config';
import { useSignOut } from '@kit/supabase/hooks/use-sign-out';
import { useUser } from '@kit/supabase/hooks/use-user';
import { pathsConfig, featureFlagsConfig } from '@kit/shared/config';
const paths = {
home: pathsConfig.app.home,
admin: pathsConfig.app.admin,

View File

@@ -14,7 +14,7 @@ export function useUser(initialData?: User | null) {
// this is most likely a session error or the user is not logged in
if (response.error) {
return undefined;
return null;
}
if (response.data?.user) {