Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[system][InitColorSchemeScript] Use let/const instead of var #43468

Merged
merged 6 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}';
let mode = localStorage.getItem('${modeStorageKey}') || 'system';
let colorScheme = '';
const dark = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
const light = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
if (mode === 'system') {
// handle system mode
var mql = window.matchMedia('(prefers-color-scheme: dark)');
ZeeshanTamboli marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading