Skip to content

Commit

Permalink
fix: remove unnecessary async from toggleDarkMode function
Browse files Browse the repository at this point in the history
  • Loading branch information
pu-raihan committed Aug 20, 2024
1 parent bf48f07 commit 3f9b902
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export default defineComponent({
this.searcher = null;
this.companyName = '';
},
async toggleDMode(): Promise<void> {
toggleDMode(): void {
toggleDarkMode();
this.darkMode = fyo.config.get('darkMode');
},
Expand Down
4 changes: 2 additions & 2 deletions src/utils/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fyo } from 'src/initFyo';

export async function toggleDarkMode(): Promise<void> {
export function toggleDarkMode(): void {
const darkMode = fyo.config.get('darkMode');
if (darkMode) {
document.documentElement.classList.remove('dark');
Expand All @@ -12,7 +12,7 @@ export async function toggleDarkMode(): Promise<void> {
}

export function setDarkMode(): void {
var darkMode = fyo.config.get('darkMode');
let darkMode = fyo.config.get('darkMode');

/* Fetching system theme */
if (darkMode === undefined){
Expand Down

0 comments on commit 3f9b902

Please sign in to comment.