Skip to content

Commit

Permalink
fix: Update InitColorSchemeScript to use const and let instead of var
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Hutchinson committed Aug 27, 2024
1 parent a32add2 commit 5ddfb5a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export default function InitColorSchemeScript(options?: InitColorSchemeScriptPro
dangerouslySetInnerHTML={{
__html: `(function() {
try {
var mode = localStorage.getItem('${modeStorageKey}') || 'system';
var colorScheme = '';
var dark = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
var light = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
const mode = localStorage.getItem('${modeStorageKey}') || 'system';
let colorScheme = '';
const dark = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
const light = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
if (mode === 'system') {
// handle system mode
var mql = window.matchMedia('(prefers-color-scheme: dark)');
Expand Down

0 comments on commit 5ddfb5a

Please sign in to comment.