forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
33 lines (29 loc) · 1.34 KB
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// React-native tooling assumes this file is here, so we just require our real entry point
/* eslint-disable @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access */
import './util/why-did-you-render'
import 'react-native-gesture-handler' // MUST BE FIRST https://github.com/software-mansion/react-native-gesture-handler/issues/320
import 'react-native-reanimated' // MUST BE HERE due to another bug https://github.com/software-mansion/react-native-reanimated/issues/4836
import './app/globals.native'
import {Appearance} from 'react-native'
import {darkModeSupported, guiConfig, install} from 'react-native-kb'
import * as DarkMode from './constants/darkmode'
import {enableMapSet} from 'immer'
console.log('------------- ios starting up ------------')
enableMapSet()
install()
const {setSystemSupported, setSystemDarkMode, setDarkModePreference} = DarkMode._useState.getState().dispatch
setSystemDarkMode(Appearance.getColorScheme() === 'dark')
setSystemSupported(darkModeSupported === '1')
try {
const obj = JSON.parse(guiConfig)
const dm = obj?.ui?.darkMode
switch (dm) {
case 'system': // fallthrough
case 'alwaysDark': // fallthrough
case 'alwaysLight':
setDarkModePreference(dm, false)
break
}
} catch (_) {}
const {load} = require('./app/index.native')
load()