From 00e4d5ed63dba86172065ff0adaeaeaae4e18aea Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Thu, 4 Jul 2024 14:37:48 +0500 Subject: [PATCH] added clearSelection after logout all sessions --- packages/client/src/store/SelectionPeopleStore.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/client/src/store/SelectionPeopleStore.js b/packages/client/src/store/SelectionPeopleStore.js index 4a030cbe1e..1a2f47a8c6 100644 --- a/packages/client/src/store/SelectionPeopleStore.js +++ b/packages/client/src/store/SelectionPeopleStore.js @@ -505,7 +505,12 @@ class SelectionStore { }; findSessionIndexByUserId = (userId) => { - return this.dataFromSocket.findIndex((data) => data.id === userId); + return this.dataFromSocket.findIndex((data) => { + if (Array.isArray(userId)) { + return userId.some((id) => id === data.id); + } + return data.id === userId; + }); }; sessisonLogout = ({ userId, date }) => { @@ -696,6 +701,7 @@ class SelectionStore { toastr.error(error); } finally { this.setIsLoading(false); + this.clearSelection(); } };