Fix contextProvider not set preventing login
This commit is contained in:
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user