Fix contextProvider not set preventing login

This commit is contained in:
Charles Bochet
2025-02-13 01:03:10 +01:00
parent eb6757f99c
commit d2a5027549

View File

@ -5,6 +5,7 @@ import { usePrefetchedData } from '@/prefetch/hooks/usePrefetchedData';
import { PrefetchKey } from '@/prefetch/types/PrefetchKey'; import { PrefetchKey } from '@/prefetch/types/PrefetchKey';
import { AppPath } from '@/types/AppPath'; import { AppPath } from '@/types/AppPath';
import { View } from '@/views/types/View'; import { View } from '@/views/types/View';
import { isNonEmptyString } from '@sniptt/guards';
import { useParams, useSearchParams } from 'react-router-dom'; import { useParams, useSearchParams } from 'react-router-dom';
import { useRecoilValue } from 'recoil'; import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared'; import { isDefined } from 'twenty-shared';
@ -28,7 +29,7 @@ const getViewId = (
return indexView.id; return indexView.id;
} }
throw new Error('No view id found'); return undefined;
}; };
export const MainContextStoreProvider = () => { export const MainContextStoreProvider = () => {
@ -73,7 +74,7 @@ export const MainContextStoreProvider = () => {
if ( if (
!isDefined(pageName) || !isDefined(pageName) ||
!isDefined(objectMetadataItem) || !isDefined(objectMetadataItem) ||
!isDefined(viewId) !isNonEmptyString(viewId)
) { ) {
return null; return null;
} }