Moved preview re-enabling logic to mixin
This commit is contained in:
parent
fb80b2cb36
commit
19494b773b
2 changed files with 4 additions and 8 deletions
|
|
@ -40,13 +40,6 @@ export default {
|
||||||
console.log(`Toggling preview to ${state}`)
|
console.log(`Toggling preview to ${state}`)
|
||||||
this.previewRequest(state)
|
this.previewRequest(state)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$root.$on('globalReenablePreview', () => {
|
|
||||||
if (this.$store.state.settings.autoGpuPreview) {
|
|
||||||
console.log("Re-enabling preview")
|
|
||||||
this.previewRequest(true)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
created: function () {
|
created: function () {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,10 @@ Vue.mixin({
|
||||||
.finally(function() {
|
.finally(function() {
|
||||||
// Reenable the GPU preview, if it was active before the modal
|
// Reenable the GPU preview, if it was active before the modal
|
||||||
console.log("Re-enabling GPU preview")
|
console.log("Re-enabling GPU preview")
|
||||||
self.$root.$emit('globalReenablePreview')
|
if (self.$store.state.settings.autoGpuPreview) {
|
||||||
|
console.log("Re-enabling preview")
|
||||||
|
self.$root.$emit('globalTogglePreview', true)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return new Promise(showModal)
|
return new Promise(showModal)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue