mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(files): better wording and catch single action run
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
8298bb44fd
commit
ea3e77d6b9
8 changed files with 19 additions and 14 deletions
|
|
@ -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 = ''
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files_trashbin-main.js
vendored
4
dist/files_trashbin-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_trashbin-main.js.map
vendored
2
dist/files_trashbin-main.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue