From 29de95fe7493ffdeb171368995f8915cf8e05c15 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 22 Jun 2021 12:06:48 +0100 Subject: [PATCH] Enforce ENABLE_IMJOY variable in store The store now won't let you enable imjoy if the environment variable is not set to "true" --- openflexure_microscope/api/static/src/store.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/api/static/src/store.js b/openflexure_microscope/api/static/src/store.js index c9965d3e..1be58fdb 100644 --- a/openflexure_microscope/api/static/src/store.js +++ b/openflexure_microscope/api/static/src/store.js @@ -116,7 +116,15 @@ export default new Vuex.Store({ state.IHIEnabled = enabled; }, changeImjoyEnabled(state, enabled) { - state.imjoyEnabled = enabled; + if (process.env.VUE_APP_ENABLE_IMJOY === "true") { + state.imjoyEnabled = enabled; + } else { + state.imjoyEnabled = false; + if (enabled) + console.warn( + "Attempted to enable ImJoy, but it's disabled by VUE_APP_ENABLE_IMJOY." + ); + } }, changeGalleryEnabled(state, enabled) { state.galleryEnabled = enabled;