fix zero addresses are selected by default when joining a community (#19626)

This commit is contained in:
Parvesh Monu 2024-04-15 17:30:31 +05:30 committed by GitHub
parent a8695116e2
commit 5412092ca1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 17 deletions

View File

@ -149,23 +149,6 @@
:on-success #(rf/dispatch [:communities/fetched-collapsed-categories-success %]) :on-success #(rf/dispatch [:communities/fetched-collapsed-categories-success %])
:on-error #(log/error "failed to fetch collapsed community categories" %)}]})) :on-error #(log/error "failed to fetch collapsed community categories" %)}]}))
(defn initialize-permission-addresses
[{:keys [db]} [community-id]]
(when community-id
(let [accounts (utils/sorted-non-watch-only-accounts db)
addresses (set (map :address accounts))]
{:db (update-in db
[:communities community-id]
assoc
:previous-share-all-addresses? true
:share-all-addresses? true
:previous-permission-addresses addresses
:selected-permission-addresses addresses
:airdrop-address (:address (first accounts)))})))
(rf/reg-event-fx :communities/initialize-permission-addresses
initialize-permission-addresses)
(defn update-previous-permission-addresses (defn update-previous-permission-addresses
[{:keys [db]} [community-id]] [{:keys [db]} [community-id]]
(when community-id (when community-id