diff --git a/src/App.vue b/src/App.vue index c05c42fd..822bd110 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,11 +11,14 @@ import NavBar from '@/components/layout/NavBar.vue'; import NavFooter from '@/components/layout/NavFooter.vue'; import BodyLayout from '@/components/layout/BodyLayout.vue'; import { setTimezone } from './shared/formatters'; +import { setProfitLossColorsCSS } from './shared/colorPreference'; import { onMounted, watch } from 'vue'; import { useSettingsStore } from './stores/settings'; const settingsStore = useSettingsStore(); onMounted(() => { setTimezone(settingsStore.timezone); + setProfitLossColorsCSS(settingsStore.colorPreference); + settingsStore.updateProfitLossColor(); }); watch( () => settingsStore.timezone, @@ -24,6 +27,12 @@ watch( setTimezone(tz); }, ); +watch( + () => settingsStore.colorPreference, + (preference) => { + setProfitLossColorsCSS(preference); + }, +);