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>

[skip ci]
  • Loading branch information
st3iny authored and backportbot[bot] committed Nov 19, 2024
1 parent bc8d432 commit b4e3e0f
Showing 1 changed file with 14 additions and 14 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

0 comments on commit b4e3e0f

Please sign in to comment.