From 2b3c0a9bac649608a7474eb2b0f19cbdb5a53a0a Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Tue, 9 Feb 2021 09:46:52 +0000 Subject: [PATCH] Make the origin override persistent The dev tools pane now remembers the last address you entered in "override origin" to save a few clicks when doing local Vue development --- .../aboutComponents/devTools.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 07806e2f..f0372c94 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/devTools.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/devTools.vue @@ -2,7 +2,7 @@
- + @@ -19,19 +19,22 @@ export default { data: function() { return { - currentOrigin: this.$store.state.origin + newOrigin: this.$store.state.origin }; }, mounted() { - if (!this.$store.getters.ready) { - this.currentOrigin = "http://microscope.local:5000"; + if (localStorage.overrideOrigin){ + this.newOrigin = localStorage.overrideOrigin; + }else{ + this.newOrigin = "http://microscope.local:5000"; } }, methods: { overrideAPIHost: function() { - this.$store.commit("changeOrigin", this.currentOrigin); + this.$store.commit("changeOrigin", this.newOrigin); + localStorage.overrideOrigin = this.newOrigin } } };