Show success toast when user joins community. (#17815)
This commit is contained in:
parent
dc571b6067
commit
ee019f79f2
|
@ -94,9 +94,17 @@
|
||||||
|
|
||||||
(defn- handle-my-request
|
(defn- handle-my-request
|
||||||
[db {:keys [community-id state deleted] :as request}]
|
[db {:keys [community-id state deleted] :as request}]
|
||||||
(if (and (= constants/community-request-to-join-state-pending state) (not deleted))
|
(let [{:keys [name]} (get-in db [:communities community-id])]
|
||||||
(assoc-in db [:communities/my-pending-requests-to-join community-id] request)
|
(cond (and (= constants/community-request-to-join-state-pending state) (not deleted))
|
||||||
(update-in db [:communities/my-pending-requests-to-join] dissoc community-id)))
|
(assoc-in db [:communities/my-pending-requests-to-join community-id] request)
|
||||||
|
(and (= constants/community-request-to-join-state-accepted state) (not deleted))
|
||||||
|
(do (re-frame/dispatch [:toasts/upsert
|
||||||
|
{:icon :i/correct
|
||||||
|
:id :joined-community
|
||||||
|
:icon-color (:positive-01 @colors/theme)
|
||||||
|
:text (i18n/label :t/joined-community {:community name})}])
|
||||||
|
(update-in db [:communities/my-pending-requests-to-join] dissoc community-id))
|
||||||
|
:else (update-in db [:communities/my-pending-requests-to-join] dissoc community-id))))
|
||||||
|
|
||||||
(defn handle-admin-request
|
(defn handle-admin-request
|
||||||
[db {:keys [id community-id deleted] :as request}]
|
[db {:keys [id community-id deleted] :as request}]
|
||||||
|
|
Loading…
Reference in New Issue