fix query response cant be undefined
This commit is contained in:
@@ -4,12 +4,10 @@ import type { User } from '@supabase/supabase-js';
|
|||||||
|
|
||||||
import { PersonalAccountDropdown } from '@kit/accounts/personal-account-dropdown';
|
import { PersonalAccountDropdown } from '@kit/accounts/personal-account-dropdown';
|
||||||
import { ApplicationRole } from '@kit/accounts/types/accounts';
|
import { ApplicationRole } from '@kit/accounts/types/accounts';
|
||||||
|
import { featureFlagsConfig, pathsConfig } from '@kit/shared/config';
|
||||||
import { useSignOut } from '@kit/supabase/hooks/use-sign-out';
|
import { useSignOut } from '@kit/supabase/hooks/use-sign-out';
|
||||||
import { useUser } from '@kit/supabase/hooks/use-user';
|
import { useUser } from '@kit/supabase/hooks/use-user';
|
||||||
|
|
||||||
import { pathsConfig, featureFlagsConfig } from '@kit/shared/config';
|
|
||||||
|
|
||||||
|
|
||||||
const paths = {
|
const paths = {
|
||||||
home: pathsConfig.app.home,
|
home: pathsConfig.app.home,
|
||||||
admin: pathsConfig.app.admin,
|
admin: pathsConfig.app.admin,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function useUser(initialData?: User | null) {
|
|||||||
|
|
||||||
// this is most likely a session error or the user is not logged in
|
// this is most likely a session error or the user is not logged in
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
return undefined;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data?.user) {
|
if (response.data?.user) {
|
||||||
|
|||||||
Reference in New Issue
Block a user