Skip to content

Commit dcd0642

Browse files
committed
Check permissions even if there's an inflight request
1 parent b4b403c commit dcd0642

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/status_im/contexts/communities/actions/addresses_for_permissions/events.cljs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,14 @@
7979
;; incorrect highest permission role.
8080
{:db (update db :communities/permissions-checks-for-selection dissoc community-id)}
8181
(let [{:keys [checking?]} (get-in db [:communities/permissions-checks-for-selection community-id])]
82-
(when-not checking?
8382
{:db (assoc-in db [:communities/permissions-checks-for-selection community-id :checking?] true)
8483
:fx [[:json-rpc/call
8584
[{:method :wakuext_checkPermissionsToJoinCommunity
8685
:params [{:communityId community-id :addresses addresses}]
8786
:on-success [:communities/check-permissions-to-join-during-selection-success
8887
community-id]
8988
:on-error [:communities/check-permissions-to-join-during-selection-failure
90-
community-id addresses]}]]]}))))
89+
community-id addresses]}]]]})))
9190

9291
;; This event should be used to check permissions temporarily because it won't
9392
;; mutate the state `:communities/permissions-check` (used by many other

src/status_im/contexts/communities/actions/addresses_for_permissions/events_test.cljs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,4 @@
103103
community-id]
104104
:on-error [:communities/check-permissions-to-join-during-selection-failure
105105
community-id addresses]}]]]}
106-
(sut/check-permissions-to-join-for-selection cofx [community-id addresses])))))
107-
108-
(testing "when there are addresses to check permissions, but currently checking, then skip the check"
109-
(let [addresses ["0xA"]
110-
cofx {:db {:communities/permissions-checks-for-selection
111-
{"other-comm-id" {}
112-
community-id {:checking? true}}}}]
113-
(is (nil? (sut/check-permissions-to-join-for-selection cofx [community-id addresses]))))))
106+
(sut/check-permissions-to-join-for-selection cofx [community-id addresses]))))))

0 commit comments

Comments
 (0)