diff --git a/packages/client/src/components/dialogs/LogoutAllSessionDialog/index.js b/packages/client/src/components/dialogs/LogoutAllSessionDialog/index.js index 5335328232..42110383c7 100644 --- a/packages/client/src/components/dialogs/LogoutAllSessionDialog/index.js +++ b/packages/client/src/components/dialogs/LogoutAllSessionDialog/index.js @@ -47,6 +47,7 @@ const LogoutAllSessionDialog = ({ onLogoutAllUsers, onLogoutAllSessions, onLogoutAllExceptThis, + setUserSessionPanelVisible, }) => { const [isChecked, setIsChecked] = useState(false); @@ -60,7 +61,7 @@ const LogoutAllSessionDialog = ({ if (!isChecked) { isSeveralSelection ? onLogoutAllUsers(t, userIds) - : onLogoutAllSessions(t); + : onLogoutAllSessions(t).then(() => setUserSessionPanelVisible(false)); onClose(); } else { onLogoutAllExceptThis(t, exceptId, displayName); diff --git a/packages/client/src/pages/PortalSettings/categories/security/sessions/index.js b/packages/client/src/pages/PortalSettings/categories/security/sessions/index.js index b812f77646..1cf3e6937e 100644 --- a/packages/client/src/pages/PortalSettings/categories/security/sessions/index.js +++ b/packages/client/src/pages/PortalSettings/categories/security/sessions/index.js @@ -99,6 +99,7 @@ const Sessions = ({ updateUserStatus, getLoginHistoryReport, isLoadingDownloadReport, + setUserSessionPanelVisible, isSessionsLoaded, }) => { const { t } = useTranslation([ @@ -197,15 +198,17 @@ const Sessions = ({ onLogoutAllUsers={onClickLogoutAllUsers} onLogoutAllSessions={onClickLogoutAllSessions} onLogoutAllExceptThis={onClickLogoutAllExceptThis} + setUserSessionPanelVisible={setUserSessionPanelVisible} /> )} ); }; -export default inject(({ settingsStore, setup, peopleStore }) => { +export default inject(({ settingsStore, setup, peopleStore, dialogsStore }) => { const { updateUserStatus } = peopleStore.usersStore; const { currentDeviceType } = settingsStore; + const { setUserSessionPanelVisible } = dialogsStore; const { allSessions, displayName, @@ -259,6 +262,7 @@ export default inject(({ settingsStore, setup, peopleStore }) => { updateUserStatus, getLoginHistoryReport, isLoadingDownloadReport, + setUserSessionPanelVisible, isSessionsLoaded: allSessions.length > 0, }; })(observer(Sessions)); diff --git a/packages/client/src/store/SelectionPeopleStore.js b/packages/client/src/store/SelectionPeopleStore.js index e489692b65..0e23da4cc6 100644 --- a/packages/client/src/store/SelectionPeopleStore.js +++ b/packages/client/src/store/SelectionPeopleStore.js @@ -646,7 +646,13 @@ class SelectionStore { return { ...data, ...session, connections }; }); - return sessions.filter((session) => session.connections.length !== 0); + const filteredSessions = sessions.filter( + (item) => + item.connections.length !== 0 && + item.sessions.some((session) => session.hasOwnProperty("id")), + ); + + return filteredSessions; } fetchData = async () => {