From e63b390e021fbe8580f93fdfbb0204ea74ca2a29 Mon Sep 17 00:00:00 2001 From: Ashok Kumar M <35134347+marks0351@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:00:11 +0530 Subject: [PATCH] fix: move useFeatureFlagOverride to routes instead of app router (#32685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX14GHmfZYDq4deKu54qT3FqPW13473c%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=FaUTV9u) ## Description Moving useFeatureFlagOverride from app router to ce routes to make sure it is available for all environments. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.MobileResponsive" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 19cabc927d62cd0216fd37c5d2c1738937544a15 > Cypress dashboard url: Click here! ## Summary by CodeRabbit - **Refactor** - Improved the timing of feature flag checks by adjusting where they are invoked in the application routing process. --- app/client/src/ce/AppRouter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/src/ce/AppRouter.tsx b/app/client/src/ce/AppRouter.tsx index 53b1d6525b..84ac386866 100644 --- a/app/client/src/ce/AppRouter.tsx +++ b/app/client/src/ce/AppRouter.tsx @@ -73,6 +73,7 @@ export function Routes() { const user = useSelector(getCurrentUserSelector); const tenantPermissions = useSelector(getTenantPermissions); const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled); + useFeatureFlagOverride(); return ( @@ -150,7 +151,6 @@ export default function AppRouter() { const safeCrashCode: ERROR_CODES | undefined = useSelector(getSafeCrashCode); const isConsolidatedPageLoading = useSelector(getIsConsolidatedPageLoading); const dispatch = useDispatch(); - useFeatureFlagOverride(); useEffect(() => { dispatch(initCurrentPage());