Commit 19494b77 authored by Joel Collins's avatar Joel Collins
Browse files

Moved preview re-enabling logic to mixin

parent fb80b2cb
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -40,13 +40,6 @@ export default {
			console.log(`Toggling preview to ${state}`)
			this.previewRequest(state)
		})

		this.$root.$on('globalReenablePreview', () => {
			if (this.$store.state.settings.autoGpuPreview) {
				console.log("Re-enabling preview")
				this.previewRequest(true)
			}
		})
	},

	created: function () {
+4 −1
Original line number Diff line number Diff line
@@ -24,7 +24,10 @@ Vue.mixin({
        .finally(function() {
          // Reenable the GPU preview, if it was active before the modal
          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)