diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2024-11-11 13:16:35 +0100 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-11-19 11:21:46 +0100 |
commit | d9eb29c52557ef76995beb1dd3e12e01b29aa1b1 (patch) | |
tree | 21b85d5f9406b9648f911a49646237d59408b3b1 /apps | |
parent | 6559c2075e46c796ff518b0e23e38534783ed194 (diff) | |
download | nextcloud-server-d9eb29c52557ef76995beb1dd3e12e01b29aa1b1.tar.gz nextcloud-server-d9eb29c52557ef76995beb1dd3e12e01b29aa1b1.zip |
fix(files): improve delete display name when trashbin is disabledfix/files/delete-display-no-trashbin
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/actions/deleteUtils.ts | 28 |
1 files changed, 14 insertions, 14 deletions
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 @@ -43,20 +43,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. */ @@ -79,6 +65,20 @@ 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 we're only selecting files, use proper wording */ if (isAllFiles(nodes)) { |