mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 11:34:45 +00:00
[#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]))
|
[status-im.chat.models :as chat]))
|
||||||
|
|
||||||
(fx/defn start-acquisition
|
(fx/defn start-acquisition
|
||||||
[{:keys [db] :as cofx} {:keys [key] :as referrer}]
|
[{:keys [db]} {:keys [key id] :as referrer} public]
|
||||||
{:db (assoc-in db [:acquisition :chat-referrer key] referrer)
|
{:db (assoc-in db [:acquisition :chat-referrer (or key id)] referrer)
|
||||||
::persistence/chat-initialized? (fn [state]
|
::persistence/chat-initialized? (fn [state]
|
||||||
(when-not (= "initialized" state)
|
(when-not (= "initialized" state)
|
||||||
(re-frame/dispatch [::start-chat referrer])))})
|
(re-frame/dispatch [::start-chat referrer public])))})
|
||||||
|
|
||||||
(fx/defn start-chat
|
(fx/defn start-chat
|
||||||
{:events [::start-chat]}
|
{:events [::start-chat]}
|
||||||
[cofx {:keys [key] :as referrer}]
|
[cofx {:keys [key id]} public]
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
{::persistence/chat-initalized! true}
|
{::persistence/chat-initalized! true}
|
||||||
(chat/start-chat key)))
|
(if public
|
||||||
|
(chat/start-public-chat id nil)
|
||||||
|
(chat/start-chat key))))
|
||||||
|
|
||||||
(fx/defn accept-pack
|
(fx/defn accept-pack
|
||||||
{:events [::accept-pack]}
|
{:events [::accept-pack]}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
(def not-found-code "notfound.click_id")
|
(def not-found-code "notfound.click_id")
|
||||||
(def advertiser-type "advertiser")
|
(def advertiser-type "advertiser")
|
||||||
(def chat-type "chat")
|
(def chat-type "chat")
|
||||||
|
(def chat-public-type "public-chat")
|
||||||
(def dapp-type "dapp")
|
(def dapp-type "dapp")
|
||||||
|
|
||||||
(fx/defn handle-registration
|
(fx/defn handle-registration
|
||||||
@ -62,8 +63,8 @@
|
|||||||
(= type advertiser-type)
|
(= type advertiser-type)
|
||||||
(advertiser/start-acquisition referrer-meta)
|
(advertiser/start-acquisition referrer-meta)
|
||||||
|
|
||||||
(= type chat-type)
|
(#{chat-type chat-public-type} type)
|
||||||
(chat/start-acquisition referrer-meta)
|
(chat/start-acquisition referrer-meta (= type chat-public-type))
|
||||||
|
|
||||||
(= type dapp-type)
|
(= type dapp-type)
|
||||||
(dapp/start-acquisition referrer-meta)))))
|
(dapp/start-acquisition referrer-meta)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user