55 lines
2.0 KiB
Plaintext
Raw Normal View History

2023-01-19 12:15:28 +01:00
(ns status-im2.core
(:require
[utils.i18n :as i18n]
[status-im2.setup.i18n-resources :as i18n-resources]
[re-frame.core :as re-frame]
[re-frame.interop :as interop]
[react-native.core :as rn]
[react-native.languages :as react-native-languages]
[react-native.platform :as platform]
[react-native.shake :as react-native-shake]
[reagent.impl.batching :as batching]
[status-im2.contexts.shell.animation :as animation]
[status-im2.config :as config]
[status-im2.setup.dev :as dev]
[status-im2.setup.global-error :as global-error]
[status-im2.common.log :as log]
[status-im.async-storage.core :as async-storage]
2023-04-26 18:14:14 +02:00
[native-module.core :as native-module]
[status-im.notifications.local :as notifications]
[status-im.utils.universal-links.core :as utils.universal-links]
status-im.events
status-im2.events
status-im2.navigation.core
status-im2.subs.root))
;;;; re-frame RN setup
(set! interop/next-tick js/setTimeout)
(set! batching/fake-raf #(js/setTimeout % 0))
2023-04-26 18:14:14 +02:00
(def adjust-resize 16)
(defn init
[]
2023-04-26 18:14:14 +02:00
(native-module/init #(re-frame/dispatch [:signals/signal-received %]))
(when platform/android?
(native-module/set-soft-input-mode adjust-resize))
(log/setup config/log-level)
(global-error/register-handler)
(notifications/listen-notifications)
(.addEventListener rn/app-state "change" #(re-frame/dispatch [:app-state-change %]))
2023-01-03 19:19:21 +01:00
(react-native-languages/add-change-listener #(fn [lang]
(i18n/set-language lang)
(i18n-resources/load-language lang)))
(react-native-shake/add-shake-listener #(re-frame/dispatch [:shake-event]))
(utils.universal-links/initialize)
;; TODO(parvesh) - Remove while moving functionality to status-go
2023-03-24 15:44:17 +05:30
(async-storage/get-item :selected-stack-id #(animation/change-selected-stack-id %))
2022-12-30 09:04:37 +05:30
(async-storage/get-item :screen-height #(reset! animation/screen-height %))
(dev/setup)
(re-frame/dispatch-sync [:setup/app-started]))