Skip to content

Commit

Permalink
Merge pull request #30450 from nextcloud/backport/30440/stable22
Browse files Browse the repository at this point in the history
[stable22] Make sure to get file model in template picker
  • Loading branch information
artonge authored Jan 3, 2022
2 parents a0c60cf + 1fa0632 commit 8127907
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions 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 8127907

Please sign in to comment.