aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/actions/deleteUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/actions/deleteUtils.ts')
-rw-r--r--apps/files/src/actions/deleteUtils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files/src/actions/deleteUtils.ts b/apps/files/src/actions/deleteUtils.ts
index ef395bae5b7..1ca7859b6c5 100644
--- a/apps/files/src/actions/deleteUtils.ts
+++ b/apps/files/src/actions/deleteUtils.ts
@@ -10,6 +10,8 @@ import { FileType } from '@nextcloud/files'
import { getCapabilities } from '@nextcloud/capabilities'
import { n, t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
+import { useUserConfigStore } from '../store/userconfig'
+import { getPinia } from '../store'
export const isTrashbinEnabled = () => (getCapabilities() as Capabilities)?.files?.undelete === true
@@ -101,6 +103,11 @@ export const displayName = (nodes: Node[], view: View) => {
return t('files', 'Delete')
}
+export const shouldAskForConfirmation = () => {
+ const userConfig = useUserConfigStore(getPinia())
+ return userConfig.userConfig.show_dialog_deletion !== false
+}
+
export const askConfirmation = async (nodes: Node[], view: View) => {
const message = view.id === 'trashbin' || !isTrashbinEnabled()
? n('files', 'You are about to permanently delete {count} item', 'You are about to permanently delete {count} items', nodes.length, { count: nodes.length })