Merge pull request #34597 from nextcloud/backport/34595/stable25

[stable25] Fix file creation issue if no action are registered
This commit is contained in:
Simon L 2022-10-27 11:57:14 +02:00 committed by GitHub
commit 592739dd97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View file

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

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long