mirror of
https://github.com/nextcloud/server.git
synced 2026-02-21 08:51:45 -05:00
Fix file creation issue if no action are registered
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
4a448f31b2
commit
a2d29eddf4
1 changed files with 11 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue