Commit efb62337 authored by Eric Eastwood's avatar Eric Eastwood

Protect against uninitialized monacoInstance

parent 335d0b96
......@@ -29,14 +29,19 @@ const RepoEditor = {
this.addMonacoEvents();
Helper.setMonacoModelFromLanguage();
this.showHide();
this.setupEditor();
})
.catch(Helper.loadingError);
},
methods: {
setupEditor() {
this.showHide();
if (this.isTree) return;
Helper.setMonacoModelFromLanguage();
},
showHide() {
if (!this.openedFiles.length || (this.binary && !this.activeFile.raw)) {
this.$el.style.display = 'none';
......@@ -109,10 +114,9 @@ const RepoEditor = {
},
blobRaw() {
this.showHide();
if (this.isTree) return;
Helper.setMonacoModelFromLanguage();
if (Helper.monacoInstance) {
this.setupEditor();
}
},
},
};
......
......@@ -4,7 +4,7 @@ import Store from '../stores/repo_store';
import '../../flash';
const RepoHelper = {
monacoInstance: {},
monacoInstance: null,
getDefaultActiveFile() {
return {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment