added method isMe

This commit is contained in:
Elyor Djalilov 2024-07-04 20:18:08 +05:00
parent 31e1838801
commit 1c9f47a211

View File

@ -492,6 +492,19 @@ class SelectionStore {
return this.fromDateAgo[sessionId] || ""; return this.fromDateAgo[sessionId] || "";
}; };
get isMe() {
const { id } = this.peopleStore.userStore.user;
const selectionUserId = this.selection.map((user) => user.id);
const userIds =
this.bufferSelection?.id !== undefined
? [this.bufferSelection.id, ...selectionUserId]
: [...selectionUserId];
return userIds.includes(id);
}
convertDate = (t, dateString, locale) => { convertDate = (t, dateString, locale) => {
const parsedDate = moment(new Date(dateString).toISOString()); const parsedDate = moment(new Date(dateString).toISOString());
const now = moment(); const now = moment();