fixed logout

This commit is contained in:
Elyor Djalilov 2024-07-04 11:14:23 +05:00
parent 7883f3152d
commit 0e9d0e9dc9
3 changed files with 14 additions and 3 deletions

View File

@ -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);

View File

@ -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}
/>
)}
</MainContainer>
);
};
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));

View File

@ -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 () => {