Skip to content

Commit

Permalink
Merge pull request #25875 from nextcloud/backport/25797/stable21
Browse files Browse the repository at this point in the history
[stable21] Do not trigger a full filelist reload after creating a new file from a template
  • Loading branch information
rullzer authored Mar 4, 2021
2 parents 27e2f06 + f1363bc commit 4df7cf1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/files/js/dist/templates.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions apps/files/src/views/TemplatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,18 @@ export default {
const fileInfo = response.data.ocs.data
this.logger.debug('Created new file', fileInfo)
await fileList?.addAndFetchFileInfo(this.name)
// Run default action
const fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)
fileAction.action(fileInfo.basename, {
$file: null,
$file: fileList?.findFileEl(this.name),
dir: currentDirectory,
fileList,
fileActions: fileList?.fileActions,
fileInfoModel: fileList?.getModelForFile(this.name),
})
// Reload files list
fileList?.reload?.() || window.location.reload()
this.close()
} catch (error) {
this.logger.error('Error while creating the new file from template')
Expand Down

0 comments on commit 4df7cf1

Please sign in to comment.