From 33b3ffc7f7c5b30d7973d0981d37067bf06ce172 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 22 Jun 2021 12:07:27 +0100 Subject: [PATCH] Rely on store to enforce IMJOY_ENABLED This removes some now-redundant code. --- .../api/static/src/components/appContent.vue | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/openflexure_microscope/api/static/src/components/appContent.vue b/openflexure_microscope/api/static/src/components/appContent.vue index 011c4e92..5fa51647 100644 --- a/openflexure_microscope/api/static/src/components/appContent.vue +++ b/openflexure_microscope/api/static/src/components/appContent.vue @@ -312,21 +312,9 @@ export default { return this.tabOrder.indexOf(this.currentTab); }, - imjoyEnabled: function() { - // Enable the ImJoy tab (and associated code) only if it is - // enabled client-side, and at build time. - // This means that the medical version of the microscope can - // disable the plugin architecture by setting the environment - // variable VUE_APP_ENABLE_IMJOY=false - if (process.env.VUE_APP_ENABLE_IMJOY === "true") { - return this.$store.state.imjoyEnabled; - } else { - return false; - } - }, - // Map the tabs from ImJoy's store module so we can display them - ...mapState("imjoy", { imjoyTabs: "tabs" }) + ...mapState("imjoy", { imjoyTabs: "tabs" }), + ...mapState({ imjoyEnabled: "imjoyEnabled" }) }, created: function() {