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, disabled: false,
}; };
const options = [ const options = [];
pinOption,
{ if (!isArchiveFolder) {
options.push(pinOption);
options.push({
key: "separator0", key: "separator0",
isSeparator: true, isSeparator: true,
}, });
archiveOptions, }
{
key: "delete-rooms", options.push(archiveOptions);
label: t("Common:Delete"), options.push({
icon: "images/trash.react.svg", key: "delete-rooms",
onClick: deleteRooms, label: t("Common:Delete"),
}, icon: "images/trash.react.svg",
]; onClick: deleteRooms,
});
return options; return options;
} }

View File

@ -1374,21 +1374,10 @@ class FilesActionStore {
}; };
getArchiveRoomsFolderOptions = (itemsCollection, t) => { 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 archive = this.getOption("unarchive", t);
const deleteOption = this.getOption("delete-room", t); const deleteOption = this.getOption("delete-room", t);
itemsCollection itemsCollection.set("unarchive", archive).set("delete", deleteOption);
.set(pinName, pin)
.set("unarchive", archive)
.set("delete", deleteOption);
return this.convertToArray(itemsCollection); return this.convertToArray(itemsCollection);
}; };