fix: view-id not updating when navigating inside modals (#19163)
This commit is contained in:
parent
2a515a82ce
commit
a06c5fdc02
|
@ -37,14 +37,14 @@
|
||||||
|
|
||||||
(navigation/reg-component-did-appear-listener
|
(navigation/reg-component-did-appear-listener
|
||||||
(fn [view-id]
|
(fn [view-id]
|
||||||
(when (get views/screens view-id)
|
(let [view-id-with-prefix (keyword (str "screen/" (name view-id)))
|
||||||
;;NOTE when back from the background on Android, this event happens for all screens, but we
|
view (or (get views/screens view-id)
|
||||||
;;need only for active one
|
(get views/screens view-id-with-prefix))
|
||||||
(when (and @state/curr-modal (= @state/curr-modal view-id))
|
view-id (:name view)]
|
||||||
(effects/set-view-id view-id))
|
(when view
|
||||||
(when-not @state/curr-modal
|
|
||||||
(effects/set-view-id view-id)
|
(effects/set-view-id view-id)
|
||||||
(reset! state/pushed-screen-id view-id)))))
|
(when-not @state/curr-modal
|
||||||
|
(reset! state/pushed-screen-id view-id))))))
|
||||||
|
|
||||||
;;;; Modal
|
;;;; Modal
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,9 @@
|
||||||
(rf/defn navigate-to-within-stack
|
(rf/defn navigate-to-within-stack
|
||||||
{:events [:navigate-to-within-stack]}
|
{:events [:navigate-to-within-stack]}
|
||||||
[{:keys [db]} comp-id]
|
[{:keys [db]} comp-id]
|
||||||
{:db (update db :modal-view-ids add-view-to-modals (first comp-id))
|
{:db (-> db
|
||||||
|
(update :modal-view-ids add-view-to-modals (first comp-id))
|
||||||
|
(assoc :view-id (first comp-id)))
|
||||||
:fx [[:navigate-to-within-stack comp-id]]})
|
:fx [[:navigate-to-within-stack comp-id]]})
|
||||||
|
|
||||||
(re-frame/reg-event-fx :open-modal
|
(re-frame/reg-event-fx :open-modal
|
||||||
|
|
Loading…
Reference in New Issue