Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
remove VuetifyTheme from the config store
Browse files Browse the repository at this point in the history
replace with materialDynamicColorSource
  • Loading branch information
TaiSakuma committed Aug 18, 2023
1 parent 3731ea3 commit 4e6c5e5
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions src/stores/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,8 @@ import {
const localStorageKey = "config";

// To be deleted -- switching to dynamic colors
export interface VuetifyTheme {
primary?: string;
"on-primary"?: string;
secondary?: string;
"on-secondary"?: string;
accent?: string;
"on-accent"?: string;
error?: string;
"on-error"?: string;
info?: string;
"on-info"?: string;
success?: string;
"on-success"?: string;
warning?: string;
"on-warning"?: string;
}

export interface WebConfig extends VuetifyTheme {
export interface WebConfig {
headTitle: string;
toolbarTitle: string;
materialDynamicColorSource: string;
Expand Down Expand Up @@ -70,7 +54,7 @@ function isInSetup() {

export const useConfigStore = defineStore("config", () => {
const error = ref<unknown | null>(null);

const inSetup = isInSetup() || undefined;

const query = ref(inSetup && useWebConfigQuery());
Expand Down Expand Up @@ -191,25 +175,6 @@ export const useConfigStore = defineStore("config", () => {
refetch();
}

const vuetifyTheme = computed(() => {
const theme_fields_base = [
"primary",
"secondary",
"accent",
"error",
"info",
"success",
"warning",
];
const theme_fields = [
...theme_fields_base,
...theme_fields_base.map((k) => `on-${k}`),
];
return theme_fields
.filter((e) => e in config.value && config.value[e])
.reduce((a, e) => ({ ...a, ...{ [e]: config.value[e] } }), {});
});

return {
error,
defaultConfig,
Expand All @@ -222,6 +187,5 @@ export const useConfigStore = defineStore("config", () => {
reset,
loadFromServer: refetch,
saveToServer,
vuetifyTheme,
};
});

0 comments on commit 4e6c5e5

Please sign in to comment.