Web:Files:Store: remove pin option from archived folder

This commit is contained in:
TimofeyBoyko 2022-07-21 10:22:51 +03:00
parent 602e4af0bb
commit 5926b22dbb
2 changed files with 16 additions and 24 deletions

View File

@ -780,20 +780,23 @@ class ContextOptionsStore {
disabled: false,
};
const options = [
pinOption,
{
const options = [];
if (!isArchiveFolder) {
options.push(pinOption);
options.push({
key: "separator0",
isSeparator: true,
},
archiveOptions,
{
key: "delete-rooms",
label: t("Common:Delete"),
icon: "images/trash.react.svg",
onClick: deleteRooms,
},
];
});
}
options.push(archiveOptions);
options.push({
key: "delete-rooms",
label: t("Common:Delete"),
icon: "images/trash.react.svg",
onClick: deleteRooms,
});
return options;
}

View File

@ -1374,21 +1374,10 @@ class FilesActionStore {
};
getArchiveRoomsFolderOptions = (itemsCollection, t) => {
let pinName = "unpin";
const { selection } = this.filesStore;
selection.forEach((item) => {
if (!item.pinned) pinName = "pin";
});
const pin = this.getOption(pinName, t);
const archive = this.getOption("unarchive", t);
const deleteOption = this.getOption("delete-room", t);
itemsCollection
.set(pinName, pin)
.set("unarchive", archive)
.set("delete", deleteOption);
itemsCollection.set("unarchive", archive).set("delete", deleteOption);
return this.convertToArray(itemsCollection);
};