fix app crashing on opening community channel (#14499)

This commit is contained in:
Parvesh Monu 2022-12-06 23:16:28 +05:30 committed by GitHub
parent 6e272a96c8
commit e6628bd346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@
[utils.re-frame :as rf] [utils.re-frame :as rf]
[utils.debounce :as debounce] [utils.debounce :as debounce]
[quo2.core :as quo] [quo2.core :as quo]
[status-im.constants :as constants]
[status-im2.navigation.state :as navigation.state] [status-im2.navigation.state :as navigation.state]
;;TODO move to status-im2 ;;TODO move to status-im2
@ -22,8 +22,10 @@
(rf/dispatch [:navigate-back]))) (rf/dispatch [:navigate-back])))
(defn page-nav [] (defn page-nav []
(let [{:keys [group-chat chat-id chat-name emoji]} (rf/sub [:chats/current-chat]) (let [{:keys [group-chat chat-id chat-name emoji chat-type]} (rf/sub [:chats/current-chat])
display-name (first (rf/sub [:contacts/contact-two-names-by-identity chat-id])) display-name (if (= chat-type constants/one-to-one-chat-type)
(first (rf/sub [:contacts/contact-two-names-by-identity chat-id]))
(str emoji " " chat-name))
online? (rf/sub [:visibility-status-updates/online? chat-id]) online? (rf/sub [:visibility-status-updates/online? chat-id])
contact (when-not group-chat (rf/sub [:contacts/contact-by-address chat-id])) contact (when-not group-chat (rf/sub [:contacts/contact-by-address chat-id]))
photo-path (when-not (empty? (:images contact)) (rf/sub [:chats/photo-path chat-id]))] photo-path (when-not (empty? (:images contact)) (rf/sub [:chats/photo-path chat-id]))]
@ -33,7 +35,7 @@
:mid-section :mid-section
(if group-chat (if group-chat
{:type :text-only {:type :text-only
:main-text (str emoji " " chat-name)} :main-text display-name}
{:type :user-avatar {:type :user-avatar
:avatar {:full-name display-name :avatar {:full-name display-name
:online? online? :online? online?