Skip to content

Commit

Permalink
Merge pull request #561 from Heigvd/COL-166
Browse files Browse the repository at this point in the history
COL-166 user reloading
  • Loading branch information
TehAwol authored Jan 26, 2024
2 parents cfcede8 + a237419 commit c5c22d1
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 c5c22d1

Please sign in to comment.