[Glitch] Fix isDarkMode utility

Port 41639655ff to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion authored and Claire committed 2026-01-13 18:35:16 +01:00
1 parent e14af55640
commit beb23500b1
1 file changed
+3 -5
@@ -5,9 +5,7 @@ export function getUserTheme() {
export function isDarkMode() {
const { userTheme } = document.documentElement.dataset;
return (
(userTheme === 'system' &&
window.matchMedia('(prefers-color-scheme: dark)').matches) ||
userTheme !== 'mastodon-light'
);
return userTheme === 'system'
? window.matchMedia('(prefers-color-scheme: dark)').matches
: userTheme !== 'mastodon-light';
}