Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error and app freezing when deselecting account one by one #18759

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,7 @@
"eligible-to-join-as": "Eligible to join as",
"you-not-eligible-to-join": "You’re 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 don’t 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.",
Expand Down