diff options
Diffstat (limited to 'app/assets/javascripts/ide/components/repo_editor.vue')
-rw-r--r-- | app/assets/javascripts/ide/components/repo_editor.vue | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index 802b7f1fa6f..3bf8308ccea 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -155,15 +155,7 @@ export default { this.editor.clearEditor(); - this.getFileData({ - path: this.file.path, - makeFileActive: false, - }) - .then(() => - this.getRawFileData({ - path: this.file.path, - }), - ) + this.fetchFileData() .then(() => { this.createEditorInstance(); }) @@ -179,6 +171,20 @@ export default { throw err; }); }, + fetchFileData() { + if (this.file.tempFile) { + return Promise.resolve(); + } + + return this.getFileData({ + path: this.file.path, + makeFileActive: false, + }).then(() => + this.getRawFileData({ + path: this.file.path, + }), + ); + }, createEditorInstance() { this.editor.dispose(); |