Skip to content

Commit

Permalink
user reloading
Browse files Browse the repository at this point in the history
no need to check that the current user has just changed. It must be performed when the current user just agreed to the terms of use
  • Loading branch information
SandraMonnier committed Jan 22, 2024
1 parent cfcede8 commit a237419
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions colab-webapp/src/main/node/app/src/API/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ export const reloadCurrentUser = createAsyncThunk('auth/reload', async (_noArg:
if (isUserAgreedTimeValid) {
// current user is authenticated
const state = thunkApi.getState() as ColabState;
if (state.websockets.sessionId != null && state.auth.currentUserId != currentUser.id) {
// Websocket session is ready AND currentUser just changed
if (state.websockets.sessionId != null) {
// Websocket session is ready
// reconnect to broadcast channel
// subscribe to the new current user channel ASAP
await restClient.WebsocketRestEndpoint.subscribeToBroadcastChannel({
Expand All @@ -332,6 +332,7 @@ export const reloadCurrentUser = createAsyncThunk('auth/reload', async (_noArg:
});
}
}

return { currentUser: currentUser, currentAccount: currentAccount, accounts: allAccounts };
});

Expand Down

0 comments on commit a237419

Please sign in to comment.