From d5e38d6843f51c4f00860848d3526a9c943687c7 Mon Sep 17 00:00:00 2001 From: akshayitzme Date: Tue, 24 Dec 2024 23:31:49 +0530 Subject: [PATCH] fix: startup error : systemSettings is not single schema --- fyo/models/SystemSettings.ts | 1 + src/App.vue | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fyo/models/SystemSettings.ts b/fyo/models/SystemSettings.ts index 59432187..71a83769 100644 --- a/fyo/models/SystemSettings.ts +++ b/fyo/models/SystemSettings.ts @@ -16,6 +16,7 @@ export default class SystemSettings extends Doc { currency?: string; version?: string; instanceId?: string; + darkMode?: boolean; validations: ValidationMap = { displayPrecision(value: DocValue) { diff --git a/src/App.vue b/src/App.vue index 00114924..0e21b0e3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -135,9 +135,9 @@ export default defineComponent({ }, async mounted() { await this.setInitialScreen(); - const { darkMode } = await fyo.doc.getDoc('SystemSettings'); - setDarkMode(!!darkMode); - this.darkMode = !!darkMode; + const darkMode = !!fyo.singles.SystemSettings?.darkMode; + setDarkMode(darkMode); + this.darkMode = darkMode; }, methods: { async setInitialScreen(): Promise {