Skip to content

Fix - Tax backwards compatibility - After disable Tax in OD display an it's not here page in ND #59565

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

Merged
9 changes: 9 additions & 0 deletions src/pages/workspace/AccessOrNotFoundWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,16 @@ function AccessOrNotFoundWrapper({
if (pendingField && !isOffline && !isFeatureEnabled) {
return;
}
// If tax feature is disabled, for instance from OD, we will navigate to the more features page.
if (!isFeatureEnabled && featureName === CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED) {
Navigation.goBack(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(policyID));
return;
}

setIsPolicyFeatureEnabled(isFeatureEnabled);
// We don't need to run the effect on policyID change as are only using it to get a route to navigate to.
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pendingField, isOffline, isFeatureEnabled]);

useEffect(() => {
Expand Down
Loading