From 6bffa6527802f45146044389f56e8a7a4b8ab088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Tue, 26 Mar 2024 15:22:03 +0100 Subject: [PATCH] Revert "fix: use settings store to retrieve useColorFallback setting (#533)" This reverts commit 23df3fba023b0386749ca9518d8518d2878e31ae. --- src/route.js | 5 +---- src/util/color.ts | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/route.js b/src/route.js index 4330c6b6..9f41c203 100644 --- a/src/route.js +++ b/src/route.js @@ -1,8 +1,6 @@ import Vue from 'vue'; import VueRouter from 'vue-router'; -import { useSettingsStore } from '~/stores/settings'; - const Home = () => import('./views/Home.vue'); // Activity views for desktop @@ -32,8 +30,7 @@ const router = new VueRouter({ { path: '/', redirect: _to => { - const settings = useSettingsStore(); - return settings.landingpage || '/home'; + return localStorage.landingpage || '/home'; }, }, { path: '/home', component: Home }, diff --git a/src/util/color.ts b/src/util/color.ts index 7c1fe1cb..f5357572 100644 --- a/src/util/color.ts +++ b/src/util/color.ts @@ -3,7 +3,6 @@ import { Category, matchString, loadClasses } from './classes'; import Color from 'color'; import * as d3 from 'd3'; import { IEvent, IBucket } from './interfaces'; -import { useSettingsStore } from '~/stores/settings'; // See here for examples: // https://bl.ocks.org/pstuffa/3393ff2711a53975040077b7453781a9 @@ -100,8 +99,10 @@ export function getCategoryColorFromString(str: string): string { function fallbackColor(str: string): string { // Get fallback color - const settings = useSettingsStore(); - if (settings.useColorFallback) { + // TODO: Fetch setting from somewhere better, where defaults are respected + const useColorFallback = + localStorage !== undefined ? localStorage.useColorFallback === 'true' : true; + if (useColorFallback) { return getColorFromString(str); } else { return COLOR_UNCAT;