mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 11:34:45 +00:00
fix new chat selected contact (#15124)
This commit is contained in:
parent
900688dc15
commit
fb155ea4bd
@ -8,6 +8,7 @@
|
|||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[utils.re-frame :as rf]
|
[utils.re-frame :as rf]
|
||||||
|
[clojure.string :as string]
|
||||||
[status-im2.common.contact-list.view :as contact-list]
|
[status-im2.common.contact-list.view :as contact-list]
|
||||||
[quo2.components.markdown.text :as text]
|
[quo2.components.markdown.text :as text]
|
||||||
[status-im.ui.components.invite.events :as invite.events]
|
[status-im.ui.components.invite.events :as invite.events]
|
||||||
@ -65,13 +66,20 @@
|
|||||||
(let [contacts (rf/sub
|
(let [contacts (rf/sub
|
||||||
[:contacts/sorted-and-grouped-by-first-letter])
|
[:contacts/sorted-and-grouped-by-first-letter])
|
||||||
selected-contacts-count (rf/sub [:selected-contacts-count])
|
selected-contacts-count (rf/sub [:selected-contacts-count])
|
||||||
|
selected-contacts (rf/sub [:group/selected-contacts])
|
||||||
window-height (rf/sub [:dimensions/window-height])
|
window-height (rf/sub [:dimensions/window-height])
|
||||||
one-contact-selected? (= selected-contacts-count 1)
|
one-contact-selected? (= selected-contacts-count 1)
|
||||||
contacts-selected? (pos? selected-contacts-count)
|
contacts-selected? (pos? selected-contacts-count)
|
||||||
{:keys [names public-key]} (-> contacts first :data first)
|
{:keys [names public-key]} (when one-contact-selected?
|
||||||
|
(rf/sub [:contacts/contact-by-identity
|
||||||
|
(first selected-contacts)]))
|
||||||
added? (reagent/atom '())
|
added? (reagent/atom '())
|
||||||
{:keys [nickname ens-name three-words-name]} names
|
{:keys [nickname ens-name display-name
|
||||||
first-username (or ens-name nickname three-words-name)
|
three-words-name]} names
|
||||||
|
first-username (or nickname
|
||||||
|
ens-name
|
||||||
|
(when-not (string/blank? display-name) display-name)
|
||||||
|
three-words-name)
|
||||||
no-contacts? (empty? contacts)]
|
no-contacts? (empty? contacts)]
|
||||||
[rn/view {:style {:height (* window-height 0.9)}}
|
[rn/view {:style {:height (* window-height 0.9)}}
|
||||||
[quo2/button
|
[quo2/button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user