Add :add-pending-contact-and-open-chat handler
This commit is contained in:
parent
3a65dcd3c2
commit
7012125024
|
@ -156,7 +156,7 @@
|
|||
:photo-path (identicon whisper-identity)
|
||||
:whisper-identity whisper-identity}]
|
||||
(if (contacts/exists? whisper-identity)
|
||||
(dispatch [:add-pending-contact whisper-identity])
|
||||
(dispatch [:add-pending-contact-and-open-chat whisper-identity])
|
||||
(dispatch [:add-new-contact-and-open-chat contact])))
|
||||
(dispatch [:set :contacts/new-public-key-error (label :t/unknown-address)]))))))
|
||||
|
||||
|
@ -348,6 +348,12 @@
|
|||
[:watch-contact contact']
|
||||
[:discoveries-send-portions chat-or-whisper-id]]})))
|
||||
|
||||
(register-handler-fx
|
||||
:add-pending-contact-and-open-chat
|
||||
(fn [_ [_ whisper-id]]
|
||||
{:dispatch-n [[:add-pending-contact whisper-id]
|
||||
[:start-chat whisper-id {:navigation-replace? true}]]}))
|
||||
|
||||
(register-handler-db
|
||||
:set-contact-identity-from-qr
|
||||
(fn [db [_ _ contact-identity]]
|
||||
|
@ -439,9 +445,8 @@
|
|||
(fn [{:keys [db]} [_ id]]
|
||||
(if (spec/valid? :global/address id)
|
||||
{::request-contact-by-address id}
|
||||
{:dispatch-n (if (get-in db [:contacts/contacts id])
|
||||
[[:add-pending-contact id]
|
||||
[:start-chat id {:navigation-replace? true}]]
|
||||
[[:add-new-contact-and-open-chat {:name (generate-gfy id)
|
||||
{:dispatch (if (get-in db [:contacts/contacts id])
|
||||
[:add-pending-contact-and-open-chat id]
|
||||
[:add-new-contact-and-open-chat {:name (generate-gfy id)
|
||||
:photo-path (identicon id)
|
||||
:whisper-identity id}]])})))
|
||||
:whisper-identity id}])})))
|
||||
|
|
Loading…
Reference in New Issue