Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not here error appears briefly when enabling features #40650

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function FeatureEnabledAccessOrNotFoundComponent(props: FeatureEnabledAccessOrNo
const shouldShowNotFoundPage = isEmptyObject(props.policy) || !props.policy?.id || !isPolicyFeatureEnabled;
const shouldShowFullScreenLoadingIndicator = props.isLoadingReportData !== false && (!Object.entries(props.policy ?? {}).length || !props.policy?.id);

// If the feature is pending, we should not update the feature state
// If the feature is pending, we should not update the feature state.
// This is due to that during the creation of a workspace the feature state changes several times while we are waiting for a response from the backend, what unexpectedly causes 'Not Found' to be shown.
puneetlath marked this conversation as resolved.
Show resolved Hide resolved
useEffect(() => {
ZhenjaHorbach marked this conversation as resolved.
Show resolved Hide resolved
if (pendingField && !isOffline && !isFeatureEnabled) {
return;
Expand Down
3 changes: 2 additions & 1 deletion src/pages/workspace/WorkspaceInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, reimbursementAcc

const protectedCollectPolicyMenuItems: WorkspaceMenuItem[] = [];

// If features are pending, we should not update feature states
// If features are pending, we should not update feature states.
// These changes are made to synchronously change feature states along with FeatureEnabledAccessOrNotFoundComponent.
useEffect(() => {
ZhenjaHorbach marked this conversation as resolved.
Show resolved Hide resolved
setFeatureStates((currentFeatureStates) => {
const newFeatureStates = {} as PolicyFeatureStates;
Expand Down
Loading