From 473a9fc73e1cd723bf5a43e88dd93902cdcdbb5d Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Aug 2023 14:31:08 -0500 Subject: [PATCH] fix bad reference on native --- src/state/models/ui/shell.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts index 0c0bb01d..6f6ed06b 100644 --- a/src/state/models/ui/shell.ts +++ b/src/state/models/ui/shell.ts @@ -8,6 +8,7 @@ import {ImageModel} from '../media/image' import {ListModel} from '../content/list' import {GalleryModel} from '../media/gallery' import {StyleProp, ViewStyle} from 'react-native' +import {isWeb} from 'platform/detection' export type ColorMode = 'system' | 'light' | 'dark' @@ -275,7 +276,7 @@ export class ShellUiModel { setColorMode(mode: ColorMode) { this.colorMode = mode - if (typeof window !== 'undefined') { + if (isWeb && typeof window !== 'undefined') { const html = window.document.documentElement // remove any other color mode classes html.className = html.className.replace(/colorMode--\w+/g, '')