Skip to content

Commit

Permalink
Re-check canAnswerQuestionType if user settings updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mlt47 committed Jul 10, 2024
1 parent 601e7ac commit 9245b32
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/state/actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ export const updateCurrentUser = (
dispatch({type: ACTION_TYPE.USER_DETAILS_UPDATE_RESPONSE_SUCCESS, user: currentUser.data});
await dispatch(requestCurrentUser() as any);

if (!editingOtherUser) {
// Invalidate tagged caches that are dependent on the current user's settings
dispatch(questionsApi.util.invalidateTags(['CanAttemptQuestionType']) as any);
}

const isFirstLogin = isFirstLoginInPersistence() || false;
if (isFirstLogin) {
persistence.session.remove(KEY.FIRST_LOGIN);
Expand Down

0 comments on commit 9245b32

Please sign in to comment.