Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-10-14 10:17:01 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-10-14 10:17:01 +0300
commit92c98864474d97e92fbe8028b8c1c44bcfca1dcb (patch)
tree461e84eee0c14f99055184521d2d0487d68c634a
parentf49ccd140fd5ada0aa640f6642464ad149c980e6 (diff)
Fix file creation issue if no action are registered
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r--apps/files/src/views/TemplatePicker.vue19
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/files/src/views/TemplatePicker.vue b/apps/files/src/views/TemplatePicker.vue
index 3a1dc15b790..33b925aa2ed 100644
--- a/apps/files/src/views/TemplatePicker.vue
+++ b/apps/files/src/views/TemplatePicker.vue
@@ -215,20 +215,23 @@ export default {
)
this.logger.debug('Created new file', fileInfo)
+ // Fetch FileInfo and model
const data = await fileList?.addAndFetchFileInfo(this.name).then((status, data) => data)
-
const model = new OCA.Files.FileInfoModel(data, {
filesClient: fileList?.filesClient,
})
+
// Run default action
const fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)
- fileAction.action(fileInfo.basename, {
- $file: fileList?.findFileEl(this.name),
- dir: currentDirectory,
- fileList,
- fileActions: fileList?.fileActions,
- fileInfoModel: model,
- })
+ if (fileAction) {
+ fileAction.action(fileInfo.basename, {
+ $file: fileList?.findFileEl(this.name),
+ dir: currentDirectory,
+ fileList,
+ fileActions: fileList?.fileActions,
+ fileInfoModel: model,
+ })
+ }
this.close()
} catch (error) {