error and app freezing when deselecting account (#18759)

This commit is contained in:
Parvesh Monu 2024-02-09 23:32:58 +05:30 committed by GitHub
parent 9acf67dd5b
commit 9dacc9e8af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 22 deletions

View File

@ -8,12 +8,6 @@
:padding-horizontal 20
:padding-vertical 12})
(def error-message
{:flex-direction :row
:gap 4
:justify-content :center
:margin-bottom 8})
(def highest-role
{:flex-direction :row
:gap 4

View File

@ -53,8 +53,9 @@
{:keys [highest-permission-role]} (rf/sub [:community/token-gated-overview id])
accounts (rf/sub [:wallet/accounts-with-customization-color])
selected-addresses (rf/sub [:communities/selected-permission-addresses id])
highest-role-text (i18n/label (communities.utils/role->translation-key
highest-permission-role))]
highest-role-text (when highest-permission-role
(i18n/label (communities.utils/role->translation-key
highest-permission-role)))]
[rn/safe-area-view {:style style/container}
[quo/drawer-top
{:type :context-tag
@ -73,7 +74,7 @@
:key-fn :address
:data accounts}]
(when (and highest-permission-role (seq selected-addresses))
(if (and highest-permission-role (seq selected-addresses))
[rn/view
{:style style/highest-role}
[quo/text
@ -84,19 +85,15 @@
{:type :icon
:icon :i/members
:size 24
:context highest-role-text}]])
(when (empty? selected-addresses)
[rn/view
{:style style/error-message}
[quo/icon
:i/info
{:color colors/danger-50
:size 16}]
[quo/text
{:size :paragraph-2
:style {:color colors/danger-50}}
(i18n/label :t/no-addresses-selected)]])
:context highest-role-text}]]
[quo/info-message
{:type :error
:size :default
:icon :i/info
:style {:justify-content :center}}
(if (empty? selected-addresses)
(i18n/label :t/no-addresses-selected)
(i18n/label :t/addresses-dont-contain-tokens-needed))])
[rn/view {:style style/buttons}
[quo/button

View File

@ -2265,6 +2265,7 @@
"eligible-to-join-as": "Eligible to join as",
"you-not-eligible-to-join": "Youre not eligible to join",
"you-hold-number-of-hold-tokens-of-these": "You hold {{number-of-hold-tokens}} of these:",
"addresses-dont-contain-tokens-needed": "These addresses dont contain tokens needed to join",
"token-gated-communities": "Token gated communities",
"read-more": "Read more",
"token-gated-communities-info": "Here will be something relevant about this topic. This will help the user get more context and therefore have a better understanding of it.",