Skip to content

Commit 882d8fd

Browse files
committed
LF-5265 Call clearOldFarmState saga before redirect to /consent to fix the same bug for Active farms with consent revoked
1 parent 4b8320e commit 882d8fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/webapp/src/containers

packages/webapp/src/containers/saga.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,14 +690,14 @@ export function* selectFarmAndFetchAllSaga({ payload: farm }) {
690690
try {
691691
yield call(selectFarmSaga, { payload: farm });
692692
const userFarm = yield select(userFarmSelector);
693+
yield call(clearOldFarmStateSaga);
693694
if (!userFarm.has_consent) {
694695
// has_consent is derived in the userFarmSelector from DB has_consent && consent_version === CONSENT_VERSION
695696
// Reachable when CONSENT_VERSION was bumped and the user hasn't re-accepted, or when an admin has changed the user's role (userFarmController.updateRole resets has_consent but leaves status='Active')
696697
// Status 'Invited' farms do not use selectFarmAndFetchAllSaga, but instead use patchUserFarmStatusWithIdTokenUrl
697698
return history.push('/consent');
698699
}
699700
history.push({ pathname: '/' });
700-
yield call(clearOldFarmStateSaga);
701701
yield call(fetchAllSaga);
702702
} catch (e) {
703703
console.error('failed to fetch farm info', e);

0 commit comments

Comments
 (0)