about summary refs log tree commit diff
path: root/src/state/models/ui/shell.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/ui/shell.ts')
-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, '')