Merge pull request #25875 from nextcloud/backport/25797/stable21

[stable21] Do not trigger a full filelist reload after creating a new file from a template
This commit is contained in:
Roeland Jago Douma 2021-03-04 15:48:23 +01:00 committed by GitHub
commit 4df7cf1f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 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

@ -208,18 +208,18 @@ export default {
const fileInfo = response.data.ocs.data const fileInfo = response.data.ocs.data
this.logger.debug('Created new file', fileInfo) this.logger.debug('Created new file', fileInfo)
await fileList?.addAndFetchFileInfo(this.name)
// Run default action // Run default action
const fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL) const fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)
fileAction.action(fileInfo.basename, { fileAction.action(fileInfo.basename, {
$file: null, $file: fileList?.findFileEl(this.name),
dir: currentDirectory, dir: currentDirectory,
fileList, fileList,
fileActions: fileList?.fileActions, fileActions: fileList?.fileActions,
fileInfoModel: fileList?.getModelForFile(this.name),
}) })
// Reload files list
fileList?.reload?.() || window.location.reload()
this.close() this.close()
} catch (error) { } catch (error) {
this.logger.error('Error while creating the new file from template') this.logger.error('Error while creating the new file from template')