Fixed web IDE review & commit editors getting into incorrect state

Closes #46392
This commit is contained in:
Phil Hughes 2018-05-18 14:00:31 +01:00
parent 2f7e0aba2f
commit 16995b8c0d
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F

View file

@ -43,9 +43,13 @@ export default {
},
},
watch: {
file(oldVal, newVal) {
file(newVal, oldVal) {
if (oldVal.pending) {
this.removePendingTab(oldVal);
}
// Compare key to allow for files opened in review mode to be cached differently
if (newVal.key !== this.file.key) {
if (oldVal.key !== this.file.key) {
this.initMonaco();
if (this.currentActivityView !== activityBarViews.edit) {
@ -99,6 +103,7 @@ export default {
'setFileViewMode',
'setFileEOL',
'updateViewer',
'removePendingTab',
]),
initMonaco() {
if (this.shouldHideEditor) return;