From 3f9b90241a2605635fc203c200d5ce25e1308a09 Mon Sep 17 00:00:00 2001 From: pu-raihan Date: Tue, 20 Aug 2024 10:36:34 +0530 Subject: [PATCH] fix: remove unnecessary async from toggleDarkMode function --- src/App.vue | 2 +- src/utils/theme.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index dc4e3b85..e6573329 100644 --- a/src/App.vue +++ b/src/App.vue @@ -260,7 +260,7 @@ export default defineComponent({ this.searcher = null; this.companyName = ''; }, - async toggleDMode(): Promise { + toggleDMode(): void { toggleDarkMode(); this.darkMode = fyo.config.get('darkMode'); }, diff --git a/src/utils/theme.ts b/src/utils/theme.ts index 86d2b2df..40ea54f5 100644 --- a/src/utils/theme.ts +++ b/src/utils/theme.ts @@ -1,6 +1,6 @@ import { fyo } from 'src/initFyo'; -export async function toggleDarkMode(): Promise { +export function toggleDarkMode(): void { const darkMode = fyo.config.get('darkMode'); if (darkMode) { document.documentElement.classList.remove('dark'); @@ -12,7 +12,7 @@ export async function toggleDarkMode(): Promise { } export function setDarkMode(): void { - var darkMode = fyo.config.get('darkMode'); + let darkMode = fyo.config.get('darkMode'); /* Fetching system theme */ if (darkMode === undefined){