Dont fetch feature flags if not logged in (#6444)

This commit is contained in:
Rishabh Saxena 2021-08-07 09:40:06 +05:30 committed by GitHub
parent 61820cc180
commit cee509011b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(