From d9eb29c52557ef76995beb1dd3e12e01b29aa1b1 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Mon, 11 Nov 2024 13:16:35 +0100 Subject: fix(files): improve delete display name when trashbin is disabled Signed-off-by: Richard Steinmetz --- apps/files/src/actions/deleteUtils.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'apps') diff --git a/apps/files/src/actions/deleteUtils.ts b/apps/files/src/actions/deleteUtils.ts index b781be0ff16..ef395bae5b7 100644 --- a/apps/files/src/actions/deleteUtils.ts +++ b/apps/files/src/actions/deleteUtils.ts @@ -42,20 +42,6 @@ export const isAllFolders = (nodes: Node[]) => { } export const displayName = (nodes: Node[], view: View) => { - /** - * If we're in the trashbin, we can only delete permanently - */ - if (view.id === 'trashbin' || !isTrashbinEnabled()) { - return t('files', 'Delete permanently') - } - - /** - * If we're in the sharing view, we can only unshare - */ - if (isMixedUnshareAndDelete(nodes)) { - return t('files', 'Delete and unshare') - } - /** * If those nodes are all the root node of a * share, we can only unshare them. @@ -78,6 +64,20 @@ export const displayName = (nodes: Node[], view: View) => { return t('files', 'Disconnect storages') } + /** + * If we're in the trashbin, we can only delete permanently + */ + if (view.id === 'trashbin' || !isTrashbinEnabled()) { + return t('files', 'Delete permanently') + } + + /** + * If we're in the sharing view, we can only unshare + */ + if (isMixedUnshareAndDelete(nodes)) { + return t('files', 'Delete and unshare') + } + /** * If we're only selecting files, use proper wording */ -- cgit v1.2.3