fix bad reference on native

zio/stable
Eric Bailey 2023-08-23 14:31:08 -05:00
parent b4931fa185
commit 473a9fc73e
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {ImageModel} from '../media/image'
import {ListModel} from '../content/list' import {ListModel} from '../content/list'
import {GalleryModel} from '../media/gallery' import {GalleryModel} from '../media/gallery'
import {StyleProp, ViewStyle} from 'react-native' import {StyleProp, ViewStyle} from 'react-native'
import {isWeb} from 'platform/detection'
export type ColorMode = 'system' | 'light' | 'dark' export type ColorMode = 'system' | 'light' | 'dark'
@ -275,7 +276,7 @@ export class ShellUiModel {
setColorMode(mode: ColorMode) { setColorMode(mode: ColorMode) {
this.colorMode = mode this.colorMode = mode
if (typeof window !== 'undefined') { if (isWeb && typeof window !== 'undefined') {
const html = window.document.documentElement const html = window.document.documentElement
// remove any other color mode classes // remove any other color mode classes
html.className = html.className.replace(/colorMode--\w+/g, '') html.className = html.className.replace(/colorMode--\w+/g, '')