From 2161fcf8750d0015d2d3913ee592c6308e9220c2 Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 2 Jul 2024 11:16:00 +0500 Subject: [PATCH] useless states were removed and refactored --- .../UserSessionsPanel/AllSessionsBlock.js | 30 +-- .../UserSessionsPanel/LastSessionBlock.js | 14 +- .../RowView/SessionsRowContent.js | 2 +- .../sub-components/RowView/index.js | 8 +- .../UserSessionsPanel/sub-components/index.js | 4 +- .../Layout/Section/Header/index.js | 16 +- .../SessionsTable/RowView/SessionsRow.js | 51 ++--- .../RowView/SessionsRowContent.js | 24 ++- .../sessions/SessionsTable/RowView/index.js | 4 +- .../TableView/SessionsTableRow.js | 45 ++--- .../sessions/SessionsTable/TableView/index.js | 2 +- .../categories/security/sessions/index.js | 4 +- .../client/src/store/SelectionPeopleStore.js | 191 +++++++++--------- 13 files changed, 184 insertions(+), 211 deletions(-) diff --git a/packages/client/src/components/panels/UserSessionsPanel/AllSessionsBlock.js b/packages/client/src/components/panels/UserSessionsPanel/AllSessionsBlock.js index 21dcebe3d5..9e1a93ead5 100644 --- a/packages/client/src/components/panels/UserSessionsPanel/AllSessionsBlock.js +++ b/packages/client/src/components/panels/UserSessionsPanel/AllSessionsBlock.js @@ -33,22 +33,20 @@ const Wrapper = styled.div` `; const AllSessionsBlock = (props) => { - const { - t, - isLoading, - connections, - userLastSession, - onClickLogoutAllExceptThis, - } = props; + const { t, isLoading, items, onClickLogoutAllExceptThis } = props; - const exceptId = userLastSession.connections[0]?.id; + const exceptId = items.connections[0]?.id; + + const filteredSessions = items.sessions.filter( + (session) => session.status === "offline", + ); return ( <> {t("Profile:AllSessions")} {t("Profile:PanelDescription")} - {connections.length > 0 ? ( + {filteredSessions.length > 0 ? (