Skip to content

Commit

Permalink
Revert "fix: use settings store to retrieve useColorFallback setting (#…
Browse files Browse the repository at this point in the history
…533)"

This reverts commit 23df3fb.
  • Loading branch information
ErikBjare committed Mar 26, 2024
1 parent 23df3fb commit 6bffa65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/route.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 },
Expand Down
7 changes: 4 additions & 3 deletions src/util/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

1 comment on commit 6bffa65

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.3b11 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.12.3b11 (click to expand)

Please sign in to comment.