about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-08-23 14:34:41 -0500
committerGitHub <noreply@github.com>2023-08-23 14:34:41 -0500
commitacad8cb4555760ca858830a4b916d2bf80c1b7b4 (patch)
treeaadce8bcb8ce3d62370750c50c17c2717bedc82d
parentb4931fa1859c73e35a98610da8c0037005fe047c (diff)
parent473a9fc73e1cd723bf5a43e88dd93902cdcdbb5d (diff)
downloadvoidsky-acad8cb4555760ca858830a4b916d2bf80c1b7b4.tar.zst
Merge pull request #1260 from bluesky-social/eric/fix-window
fix bad reference on native
-rw-r--r--src/state/models/ui/shell.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts
index 0c0bb01d7..6f6ed06bc 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, '')