diff --git a/frontend/src/layouts/BaseLayout.vue b/frontend/src/layouts/BaseLayout.vue index ff211072b..3a6af0672 100644 --- a/frontend/src/layouts/BaseLayout.vue +++ b/frontend/src/layouts/BaseLayout.vue @@ -52,8 +52,13 @@
-
- {{ userDisplayName }} +
+ + {{ userDisplayName }} + + + 🧙 Advanced mode is on +
@@ -71,29 +76,44 @@
-
+ +
+ - + + + + Advanced mode {{ advancedMode ? 'on' : 'off' }} + + + + Enables advanced features such as private key export, additional recipient ID options, and event + scanning settings. Use with caution! + + +
-
+ + +
Built by ScopeLift
-
+ + +
@@ -112,19 +132,18 @@ diff --git a/frontend/src/store/settings.ts b/frontend/src/store/settings.ts new file mode 100644 index 000000000..53b831c4a --- /dev/null +++ b/frontend/src/store/settings.ts @@ -0,0 +1,17 @@ +import { computed, onMounted, ref } from '@vue/composition-api'; +import { LocalStorage } from 'quasar'; + +// Shared state between instances +const advancedMode = ref(false); // true if user has advanced mode turned on + +// Composition function for managing state +export default function useSettingsStore() { + onMounted(() => (advancedMode.value = Boolean(LocalStorage.getItem('advanced-mode')))); + + function toggleAdvancedMode() { + advancedMode.value = !advancedMode.value; + LocalStorage.set('advanced-mode', advancedMode.value); + } + + return { toggleAdvancedMode, advancedMode: computed(() => advancedMode.value) }; +}