From a237419cfcb84bbd7f87bd18becc8052c609bcbd Mon Sep 17 00:00:00 2001 From: Sandra Monnier <70577952+SandraMonnier@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:19:06 +0100 Subject: [PATCH] user reloading 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 --- colab-webapp/src/main/node/app/src/API/api.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/colab-webapp/src/main/node/app/src/API/api.ts b/colab-webapp/src/main/node/app/src/API/api.ts index 511d31ae18..2bbee8fd35 100644 --- a/colab-webapp/src/main/node/app/src/API/api.ts +++ b/colab-webapp/src/main/node/app/src/API/api.ts @@ -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({ @@ -332,6 +332,7 @@ export const reloadCurrentUser = createAsyncThunk('auth/reload', async (_noArg: }); } } + return { currentUser: currentUser, currentAccount: currentAccount, accounts: allAccounts }; });