fix: Unable to add new contact on receiver device after local pairing until app relaunch (#14936)

This commit is contained in:
frank 2023-02-03 16:07:27 +08:00 committed by GitHub
parent e4722e05f3
commit 0472140f02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 6 deletions

View File

@ -54,9 +54,9 @@
:peers-count (count (:peers peer-stats)))}))
(defn handle-local-pairing-signals
[signal-type]
(log/info "local pairing signal received"
{:signal-type signal-type}))
[event]
(log/debug "local pairing signal received"
{:event event}))
(rf/defn process
{:events [:signals/signal-received]}
@ -110,5 +110,5 @@
"status.updates.timedout" (visibility-status-updates/handle-visibility-status-updates
cofx
(js->clj event-js :keywordize-keys true))
"localPairing" (handle-local-pairing-signals event-str)
"localPairing" (handle-local-pairing-signals (js->clj event-js :keywordize-keys true))
(log/debug "Event " type " not handled"))))

View File

@ -273,3 +273,9 @@
(def ^:const theme-type-light 1)
(def ^:const theme-type-dark 2)
(def ^:const bottom-sheet-animation-delay 450)
(def ^:const local-pair-event-process-success "process-success")
(def ^:const local-pair-event-process-error "process-error")
(def ^:const local-pair-action-connect 1)
(def ^:const local-pair-action-pairing-account 2)
(def ^:const local-pair-action-sync-device 3)

View File

@ -25,7 +25,10 @@
(defn dismiss-all-modals
[]
(log/debug "dissmiss-all-modals")
(log/debug "dissmiss-all-modals"
{:curr-modal @state/curr-modal
:modals @state/modals
:dissmissing @state/dissmissing})
(when @state/curr-modal
(reset! state/curr-modal false)
(reset! state/dissmissing true)
@ -75,7 +78,11 @@
(defn open-modal
[comp]
(log/debug "open-modal" comp)
(log/debug "open-modal"
{:comp comp
:dissmissing @state/dissmissing
:curr-modal @state/curr-modal
:modals @state/modals})
(let [{:keys [options]} (get views/screens comp)]
(if @state/dissmissing
(reset! state/dissmissing comp)
@ -122,6 +129,10 @@
(defn modal-dismissed-listener
[]
(log/debug "modal-dismissed"
{:modals @state/modals
:curr-modal @state/curr-modal
:dissmissing @state/dissmissing})
(if (> (count @state/modals) 1)
(let [new-modals (butlast @state/modals)]
(reset! state/modals (vec new-modals))
@ -180,6 +191,7 @@
:init-root-fx
(fn [new-root-id]
(log/debug :init-root-fx new-root-id)
(dismiss-all-modals)
(reset! state/root-comp-id new-root-id)
(reset! state/root-id @state/root-comp-id)
(navigation/set-root (get (roots/roots) new-root-id))))
@ -188,6 +200,7 @@
:init-root-with-component-fx
(fn [[new-root-id new-root-comp-id]]
(log/debug :init-root-with-component-fx new-root-id new-root-comp-id)
(dismiss-all-modals)
(reset! state/root-comp-id new-root-comp-id)
(reset! state/root-id @state/root-comp-id)
(navigation/set-root (get (roots/roots) new-root-id))))