Shifted mode ternary to a variable

This commit is contained in:
aarya-16
2024-10-28 17:03:52 +05:30
parent 0c3d8245e9
commit 7a559977ca

View File

@@ -1,5 +1,7 @@
import { createSlice } from "@reduxjs/toolkit";
const initialMode = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches ? "dark" : "light";
// Initial state for UI settings.
// Add more settings as needed (e.g., theme preferences, user settings)
const initialState = {
@@ -15,7 +17,7 @@ const initialState = {
sidebar: {
collapsed: false,
},
mode: window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches? "dark": "light",
mode: initialMode,
greeting: { index: 0, lastUpdate: null },
timezone: "America/Toronto",
};