diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/devTools.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/devTools.vue index fecf56de..08f47e9b 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/devTools.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/devTools.vue @@ -1,12 +1,26 @@ @@ -19,7 +33,8 @@ export default { data: function() { return { - newOrigin: this.$store.state.origin + newOrigin: this.$store.state.origin, + reloadWhenOverridingOrigin: true }; }, @@ -32,9 +47,21 @@ export default { }, methods: { - overrideAPIHost: function() { - this.$store.commit("changeOrigin", this.newOrigin); + overrideAPIHost: function(event) { + // Save the origin override, so that if we reload the web app, you can easily localStorage.overrideOrigin = this.newOrigin; + + // If we have elected not to reload the interface, just update the origin + // in the store. Otherwise, the form's default action will do the job for us. + // TODO: preserve other query parameters when reloading + if(!this.reloadWhenOverridingOrigin){ + this.$store.commit("changeOrigin", this.newOrigin); + event.preventDefault(); + } + }, + resetTour: function() { + // Make the introduction tour run next time the app loads + this.setLocalStorageObj("completedTour", false); } } };