mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-14 18:54:52 +00:00
fix(dev exp): auto disable fast refresh on iOS (#20120)
This commit is contained in:
parent
60ef4fab4b
commit
c19f170239
@ -1,6 +1,6 @@
|
|||||||
(ns status-im.setup.dev
|
(ns status-im.setup.dev
|
||||||
(:require
|
(:require
|
||||||
["react-native" :refer (DevSettings LogBox)]
|
["react-native" :refer (DevSettings LogBox NativeModules)]
|
||||||
[react-native.platform :as platform]
|
[react-native.platform :as platform]
|
||||||
[status-im.setup.schema :as schema]
|
[status-im.setup.schema :as schema]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
@ -48,9 +48,15 @@
|
|||||||
:json-rpc/call})
|
:json-rpc/call})
|
||||||
(when ^:boolean js/goog.DEBUG
|
(when ^:boolean js/goog.DEBUG
|
||||||
(schema/setup!)
|
(schema/setup!)
|
||||||
(when (and platform/ios? DevSettings)
|
(when platform/ios?
|
||||||
;;on Android this method doesn't work
|
;; on Android this method doesn't work
|
||||||
(when-let [nm (.-_nativeModule DevSettings)]
|
(when-let [setHotLoadingEnabled (or
|
||||||
|
(and NativeModules
|
||||||
|
(.-DevSettings NativeModules)
|
||||||
|
(.-setHotLoadingEnabled (.-DevSettings NativeModules)))
|
||||||
|
(and DevSettings
|
||||||
|
(.-_nativeModule DevSettings)
|
||||||
|
(.-setHotLoadingEnabled (.-_nativeModule DevSettings))))]
|
||||||
;;there is a bug in RN, so we have to enable it first and then disable
|
;;there is a bug in RN, so we have to enable it first and then disable
|
||||||
(.setHotLoadingEnabled ^js nm true)
|
(setHotLoadingEnabled true)
|
||||||
(js/setTimeout #(.setHotLoadingEnabled ^js nm false) 1000)))))
|
(js/setTimeout #(setHotLoadingEnabled false) 1000)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user