Skip to content

Commit

Permalink
Check permissions even if there's an inflight request
Browse files Browse the repository at this point in the history
  • Loading branch information
cammellos committed Mar 28, 2024
1 parent 6c07fac commit f1193b5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,14 @@
;; incorrect highest permission role.
{:db (update db :communities/permissions-checks-for-selection dissoc community-id)}
(let [{:keys [checking?]} (get-in db [:communities/permissions-checks-for-selection community-id])]
(when-not checking?
{:db (assoc-in db [:communities/permissions-checks-for-selection community-id :checking?] true)
:fx [[:json-rpc/call
[{:method :wakuext_checkPermissionsToJoinCommunity
:params [{:communityId community-id :addresses addresses}]
:on-success [:communities/check-permissions-to-join-during-selection-success
community-id]
:on-error [:communities/check-permissions-to-join-during-selection-failure
community-id addresses]}]]]}))))
community-id addresses]}]]]})))

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

0 comments on commit f1193b5

Please sign in to comment.