Skip to content

Commit

Permalink
fix(files): improve delete display name when trashbin is disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny committed Nov 19, 2024
1 parent bc8d432 commit 43b0df9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions apps/files/src/actions/deleteUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

0 comments on commit 43b0df9

Please sign in to comment.