added getItems for updating panel state

This commit is contained in:
Elyor Djalilov 2024-07-08 12:50:54 +05:00
parent 6c98015340
commit 5f6fff52ae
3 changed files with 9 additions and 4 deletions

View File

@ -72,11 +72,11 @@ const AllSessionsBlock = (props) => {
};
export default inject(({ peopleStore }) => {
const { items, isLoading, fetchData, onClickLogoutAllExceptThis } =
const { getItems, isLoading, fetchData, onClickLogoutAllExceptThis } =
peopleStore.selectionStore;
return {
items,
items: getItems,
isLoading,
fetchData,
onClickLogoutAllExceptThis,

View File

@ -230,12 +230,12 @@ const LastSessionBlock = (props) => {
export default inject(({ setup, peopleStore }) => {
const { setDisableDialogVisible, setLogoutAllDialogVisible } = setup;
const { isMe, getFromDateAgo, items, setDisplayName } =
const { getItems, isMe, getFromDateAgo, setDisplayName } =
peopleStore.selectionStore;
return {
isMe,
items,
items: getItems,
getFromDateAgo,
setDisplayName,
setDisableDialogVisible,

View File

@ -505,6 +505,11 @@ class SelectionStore {
return userIds.includes(id);
}
get getItems() {
if (!this.items) return {};
return this.allSessions.find((item) => item.id === this.items.id) ?? {};
}
convertDate = (t, dateString, locale) => {
const parsedDate = moment(new Date(dateString).toISOString());
const now = moment();