Merge pull request #30448 from nextcloud/backport/30440/stable21

[stable21] Make sure to get file model in template picker
This commit is contained in:
MichaIng 2021-12-31 21:27:41 +01:00 committed by GitHub
commit 949fb2343a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -213,8 +213,11 @@ export default {
)
this.logger.debug('Created new file', fileInfo)
await fileList?.addAndFetchFileInfo(this.name)
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, {
@ -222,7 +225,7 @@ export default {
dir: currentDirectory,
fileList,
fileActions: fileList?.fileActions,
fileInfoModel: fileList?.getModelForFile(this.name),
fileInfoModel: model,
})
this.close()