Fix for tapping on new contact from contact list (#14737)

* Tapping on new contact from Contact list leads to empty chat with skeleton

* Code style fix

* Small removals of unused stuff
This commit is contained in:
Alexander 2023-01-10 19:26:23 +01:00 committed by GitHub
parent 43da198c3f
commit 9ed89ac97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -2,7 +2,6 @@
(:require [quo2.core :as quo] (:require [quo2.core :as quo]
[quo2.foundations.colors :as colors] [quo2.foundations.colors :as colors]
[react-native.core :as rn] [react-native.core :as rn]
[react-native.platform :as platform]
[status-im2.common.home.actions.view :as actions] [status-im2.common.home.actions.view :as actions]
[status-im2.contexts.chat.home.chat-list-item.style :as style] [status-im2.contexts.chat.home.chat-list-item.style :as style]
[utils.address :as utils.address] [utils.address :as utils.address]
@ -14,9 +13,7 @@
(let [view-id (rf/sub [:view-id])] (let [view-id (rf/sub [:view-id])]
(when (= view-id :shell-stack) (when (= view-id :shell-stack)
(rf/dispatch [:dismiss-keyboard]) (rf/dispatch [:dismiss-keyboard])
(if platform/android? (rf/dispatch [:chat.ui/show-profile chat-id])
(rf/dispatch [:chat.ui/navigate-to-chat-nav2 chat-id])
(rf/dispatch [:chat.ui/navigate-to-chat chat-id]))
(rf/dispatch [:search/home-filter-changed nil])))) (rf/dispatch [:search/home-filter-changed nil]))))
(defn action-icon (defn action-icon
@ -52,7 +49,7 @@
(rf/dispatch [:deselect-member public-key true])))))}])])) (rf/dispatch [:deselect-member public-key true])))))}])]))
(defn contact-list-item (defn contact-list-item
[item _ _ {:keys [group start-a-new-chat? on-toggle] :as extra-data}] [item _ _ {:keys [start-a-new-chat? on-toggle] :as extra-data}]
(let [{:keys [public-key ens-verified added? images]} item (let [{:keys [public-key ens-verified added? images]} item
display-name (first (rf/sub display-name (first (rf/sub
[:contacts/contact-two-names-by-identity [:contacts/contact-two-names-by-identity
@ -71,9 +68,8 @@
:on-press #(if start-a-new-chat? :on-press #(if start-a-new-chat?
(on-toggle true user-selected? public-key) (on-toggle true user-selected? public-key)
(open-chat public-key)) (open-chat public-key))
:on-long-press #(when (some? group) :on-long-press #(rf/dispatch [:bottom-sheet/show-sheet
(rf/dispatch [:bottom-sheet/show-sheet {:content (fn [] [actions/actions item extra-data])}])})
{:content (fn [] [actions/actions item extra-data])}]))})
[quo/user-avatar [quo/user-avatar
{:full-name display-name {:full-name display-name
:profile-picture photo-path :profile-picture photo-path