fix: missing initialize setup fns

pull/3496/head^2
charlie 2021-12-16 13:29:15 +08:00 committed by Tienson Qin
parent 7d4e30ed29
commit 7e14a12686
1 changed files with 7 additions and 7 deletions

View File

@ -10,11 +10,12 @@
[view route-match]
(view route-match))
(defn- teardown-fn
(defn- setup-fns!
[]
(try
(ui/setup-active-keystroke!)
(ui/setup-patch-ios-visual-viewport-state!)
(comp
(ui/setup-active-keystroke!)
(ui/setup-patch-ios-visual-viewport-state!))
(catch js/Error _e
nil)))
@ -25,11 +26,10 @@
(ui/inject-document-devices-envs!)
(ui/inject-dynamic-style-node!)
(plugin-handler/host-mounted!)
(assoc state ::teardown teardown-fn))
(assoc state ::teardown (setup-fns!) ))
:will-unmount (fn [state]
(let [teardown (::teardown state)]
(when-not (nil? teardown)
(teardown))))}
(when-let [teardown (::teardown state)]
(teardown)))}
[]
(when-let [route-match (state/sub :route-match)]
(i18n/tongue-provider