Web:Files:Store: remove pin option from archived folder
This commit is contained in:
parent
602e4af0bb
commit
5926b22dbb
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user