Update src/platform/web/Platform.js

Co-authored-by: Bruno Windels <274386+bwindels@users.noreply.github.com>
This commit is contained in:
R Midhun Suresh 2022-05-12 12:48:34 +05:30 committed by GitHub
parent cc88245933
commit d5bc9f5d7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,7 +317,7 @@ export class Platform {
}
get preferredColorScheme() {
if (window.matchMedia("(prefers-color-scheme: dark)")) {
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
return COLOR_SCHEME_PREFERENCE.DARK;
} else if (window.matchMedia("(prefers-color-scheme: light)")) {
return COLOR_SCHEME_PREFERENCE.LIGHT;