)
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) {