diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-05 17:34:47 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-06 15:43:30 +0200 |
commit | ea3e77d6b91e86fd14e40dc1b68ed8a887c93c2c (patch) | |
tree | 2b418b35a476880996bc7dd9212ffacab184f6c8 /apps | |
parent | 8298bb44fdb14024d8e7c0d651a4b219b8975f0e (diff) | |
download | nextcloud-server-ea3e77d6b91e86fd14e40dc1b68ed8a887c93c2c.tar.gz nextcloud-server-ea3e77d6b91e86fd14e40dc1b68ed8a887c93c2c.zip |
fix(files): better wording and catch single action run
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 11 | ||||
-rw-r--r-- | apps/files/src/components/FilesListHeaderActions.vue | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 260294e1a36..130cd12367e 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -103,7 +103,7 @@ import { debounce } from 'debounce' import { formatFileSize } from '@nextcloud/files' import { Fragment } from 'vue-fragment' import { join } from 'path' -import { showError } from '@nextcloud/dialogs' +import { showError, showSuccess } from '@nextcloud/dialogs' import { translate } from '@nextcloud/l10n' import CancelablePromise from 'cancelable-promise' import FileIcon from 'vue-material-design-icons/File.vue' @@ -434,10 +434,15 @@ export default Vue.extend({ const displayName = action.displayName([this.source], this.currentView) try { this.loading = action.id - await action.exec(this.source, this.currentView) + const success = await action.exec(this.source, this.currentView) + if (success) { + showSuccess(this.t('files', '"{displayName}" action executed successfully', { displayName })) + return + } + showError(this.t('files', '"{displayName}" action failed', { displayName })) } catch (e) { logger.error('Error while executing action', { action, e }) - showError(this.t('files', 'Error while executing action "{displayName}"', { displayName })) + showError(this.t('files', '"{displayName}" action failed', { displayName })) } finally { this.loading = '' } diff --git a/apps/files/src/components/FilesListHeaderActions.vue b/apps/files/src/components/FilesListHeaderActions.vue index 5cf0fdbe373..b7d48f1de25 100644 --- a/apps/files/src/components/FilesListHeaderActions.vue +++ b/apps/files/src/components/FilesListHeaderActions.vue @@ -136,11 +136,11 @@ export default Vue.extend({ } // Show success message and clear selection - showSuccess(this.t('files', '"{displayName}" batch action successfully executed', { displayName })) + showSuccess(this.t('files', '"{displayName}" batch action executed successfully', { displayName })) this.selectionStore.reset() } catch (e) { logger.error('Error while executing action', { action, e }) - showError(this.t('files', 'Error while executing action "{displayName}"', { displayName })) + showError(this.t('files', '"{displayName}" action failed', { displayName })) } finally { this.loading = null } |