Skip to content

Commit

Permalink
Merge pull request #30448 from nextcloud/backport/30440/stable21
Browse files Browse the repository at this point in the history
[stable21] Make sure to get file model in template picker
  • Loading branch information
MichaIng authored Dec 31, 2021
2 parents 1fcfda2 + 5767a5d commit 949fb23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/files/js/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files/js/dist/main.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions apps/files/src/views/TemplatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,19 @@ 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, {
$file: fileList?.findFileEl(this.name),
dir: currentDirectory,
fileList,
fileActions: fileList?.fileActions,
fileInfoModel: fileList?.getModelForFile(this.name),
fileInfoModel: model,
})
this.close()
Expand Down

0 comments on commit 949fb23

Please sign in to comment.