[#11236] Deeplink to public chat on onboarding
Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
parent
a91bdfb047
commit
cf911aa246
|
@ -8,18 +8,20 @@
|
|||
[status-im.chat.models :as chat]))
|
||||
|
||||
(fx/defn start-acquisition
|
||||
[{:keys [db] :as cofx} {:keys [key] :as referrer}]
|
||||
{:db (assoc-in db [:acquisition :chat-referrer key] referrer)
|
||||
[{:keys [db]} {:keys [key id] :as referrer} public]
|
||||
{:db (assoc-in db [:acquisition :chat-referrer (or key id)] referrer)
|
||||
::persistence/chat-initialized? (fn [state]
|
||||
(when-not (= "initialized" state)
|
||||
(re-frame/dispatch [::start-chat referrer])))})
|
||||
(re-frame/dispatch [::start-chat referrer public])))})
|
||||
|
||||
(fx/defn start-chat
|
||||
{:events [::start-chat]}
|
||||
[cofx {:keys [key] :as referrer}]
|
||||
[cofx {:keys [key id]} public]
|
||||
(fx/merge cofx
|
||||
{::persistence/chat-initalized! true}
|
||||
(chat/start-chat key)))
|
||||
(if public
|
||||
(chat/start-public-chat id nil)
|
||||
(chat/start-chat key))))
|
||||
|
||||
(fx/defn accept-pack
|
||||
{:events [::accept-pack]}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
(def not-found-code "notfound.click_id")
|
||||
(def advertiser-type "advertiser")
|
||||
(def chat-type "chat")
|
||||
(def chat-public-type "public-chat")
|
||||
(def dapp-type "dapp")
|
||||
|
||||
(fx/defn handle-registration
|
||||
|
@ -62,8 +63,8 @@
|
|||
(= type advertiser-type)
|
||||
(advertiser/start-acquisition referrer-meta)
|
||||
|
||||
(= type chat-type)
|
||||
(chat/start-acquisition referrer-meta)
|
||||
(#{chat-type chat-public-type} type)
|
||||
(chat/start-acquisition referrer-meta (= type chat-public-type))
|
||||
|
||||
(= type dapp-type)
|
||||
(dapp/start-acquisition referrer-meta)))))
|
||||
|
|
Loading…
Reference in New Issue