diff --git a/src/status_im/contact/core.cljs b/src/status_im/contact/core.cljs index 9d9287b88f..542d6dff22 100644 --- a/src/status_im/contact/core.cljs +++ b/src/status_im/contact/core.cljs @@ -260,10 +260,9 @@ (def receive-contact-request-confirmation handle-contact-update) (def receive-contact-update handle-contact-update) -(fx/defn add-contact-and-open-chat +(fx/defn open-chat [cofx public-key] (fx/merge cofx - (add-contact public-key) (chat.models/start-chat public-key {:navigation-reset? true}))) (fx/defn hide-contact @@ -283,8 +282,8 @@ (fx/merge cofx fx (if config/partitioned-topic-enabled? - (add-contacts-filter contact-identity :add-contact-and-open-chat) - (add-contact-and-open-chat contact-identity)))))) + (add-contacts-filter contact-identity :open-chat) + (open-chat contact-identity)))))) (fx/defn open-contact-toggle-list [{:keys [db :as cofx]}] @@ -297,4 +296,4 @@ (fx/defn add-new-identity-to-contacts [{{:contacts/keys [new-identity]} :db :as cofx}] (when (seq new-identity) - (add-contact-and-open-chat cofx new-identity))) + (open-chat cofx new-identity))) diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 12914e6042..dc4b8c8c06 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -1542,7 +1542,7 @@ (handlers/register-handler-fx :contact/filters-added (fn [cofx [_ contact-identity]] - (contact/add-contact-and-open-chat cofx contact-identity))) + (contact/open-chat cofx contact-identity))) (handlers/register-handler-fx :contact.ui/start-group-chat-pressed @@ -1553,7 +1553,7 @@ :contact.ui/send-message-pressed [(re-frame/inject-cofx :random-id-generator)] (fn [cofx [_ {:keys [public-key]}]] - (contact/add-contact-and-open-chat cofx public-key))) + (contact/open-chat cofx public-key))) (handlers/register-handler-fx :contact.ui/contact-code-submitted diff --git a/src/status_im/transport/filters.cljs b/src/status_im/transport/filters.cljs index d54f86da40..1dd69af0bf 100644 --- a/src/status_im/transport/filters.cljs +++ b/src/status_im/transport/filters.cljs @@ -96,8 +96,8 @@ :add-contact (contact/add-contact public-key) - :add-contact-and-open-chat - (contact/add-contact-and-open-chat public-key)))] + :open-chat + (contact/open-chat public-key)))] filters-fx-fns [(mailserver/process-next-messages-request)])))))