diff options
Diffstat (limited to 'app/assets/javascripts/repo/components/repo_editor.vue')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_editor.vue | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/assets/javascripts/repo/components/repo_editor.vue b/app/assets/javascripts/repo/components/repo_editor.vue index 0714ba90b6f..8b717e2330b 100644 --- a/app/assets/javascripts/repo/components/repo_editor.vue +++ b/app/assets/javascripts/repo/components/repo_editor.vue @@ -51,6 +51,8 @@ export default { .catch(() => flash('Error setting up monaco. Please try again.')); }, setupEditor() { + if (!this.activeFile) return; + const foundLang = this.languages.find(lang => lang.extensions && lang.extensions.indexOf(this.activeFileExtension) === 0, ); @@ -71,7 +73,7 @@ export default { }, watch: { activeFile(oldVal, newVal) { - if (newVal.active) { + if (!newVal.active) { this.initMonaco(); } }, |