diff --git a/app/client/src/sagas/userSagas.tsx b/app/client/src/sagas/userSagas.tsx index 9701313f70..8c96adfe43 100644 --- a/app/client/src/sagas/userSagas.tsx +++ b/app/client/src/sagas/userSagas.tsx @@ -101,6 +101,11 @@ export function* getCurrentUserSaga() { response.data.username !== ANONYMOUS_USERNAME ) { AnalyticsUtil.identifyUser(response.data); + // make fetch feature call only if logged in + yield put(fetchFeatureFlagsInit()); + } else { + // reset the flagsFetched flag + yield put(fetchFeatureFlagsSuccess()); } if (window.location.pathname === BASE_URL) { if (response.data.isAnonymous) { @@ -116,8 +121,6 @@ export function* getCurrentUserSaga() { PerformanceTracker.stopAsyncTracking( PerformanceTransactionName.USER_ME_API, ); - - yield put(fetchFeatureFlagsInit()); } } catch (error) { PerformanceTracker.stopAsyncTracking(