Skip to content

Commit 8bd2235

Browse files
committed
Add configuration option to disable downloads
Refs: os-js/OS.js#795
1 parent cd271d3 commit 8bd2235

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,15 @@ const menuFactory = (core, proc, win) => {
558558
}
559559

560560
const appendItems = await menuItemsFromMiddleware('edit', {file: item, isContextMenu});
561+
const configuredItems = [];
562+
563+
if (core.config('filemanager.disableDownload', false) !== true) {
564+
configuredItems.push({
565+
label: _('LBL_DOWNLOAD'),
566+
disabled: !item || isDirectory || !isValidFile,
567+
onclick: () => emitter('filemanager:menu:download')
568+
});
569+
}
561570

562571
return [
563572
...openMenu,
@@ -572,11 +581,7 @@ const menuFactory = (core, proc, win) => {
572581
onclick: () => emitter('filemanager:menu:delete')
573582
},
574583
...clipboardMenu,
575-
{
576-
label: _('LBL_DOWNLOAD'),
577-
disabled: !item || isDirectory || !isValidFile,
578-
onclick: () => emitter('filemanager:menu:download')
579-
},
584+
...configuredItems,
580585
...appendItems
581586
];
582587
};

0 commit comments

Comments
 (0)