[Fix] Admin Notification marked unread after closing and reopening AC (#14824)
* [Fix][#14823] Admin Notification unread issue * [Fix][#14823] Changed dispatch of event from the PR feedback * [Fix][#14823] Organize dispatch of event from the PR feedback * [Fix][#14823] Organize dispatch of event from the PR feedback
This commit is contained in:
parent
897a5eb201
commit
6722b45076
|
@ -558,16 +558,20 @@
|
||||||
(rf/defn request-to-join-accepted
|
(rf/defn request-to-join-accepted
|
||||||
{:events [::request-to-join-accepted]}
|
{:events [::request-to-join-accepted]}
|
||||||
[{:keys [db] :as cofx} community-id request-id response-js]
|
[{:keys [db] :as cofx} community-id request-id response-js]
|
||||||
(rf/merge cofx
|
(rf/merge
|
||||||
{:db (update-in db [:communities/requests-to-join community-id] dissoc request-id)}
|
cofx
|
||||||
(handle-response response-js)))
|
{:db (update-in db [:communities/requests-to-join community-id] dissoc request-id)
|
||||||
|
:dispatch-n [[:sanitize-messages-and-process-response response-js]
|
||||||
|
[:activity-center.notifications/mark-as-read request-id]]}))
|
||||||
|
|
||||||
(rf/defn request-to-join-declined
|
(rf/defn request-to-join-declined
|
||||||
{:events [::request-to-join-declined]}
|
{:events [::request-to-join-declined]}
|
||||||
[{:keys [db] :as cofx} community-id request-id response-js]
|
[{:keys [db] :as cofx} community-id request-id response-js]
|
||||||
(rf/merge cofx
|
(rf/merge
|
||||||
{:db (update-in db [:communities/requests-to-join community-id] dissoc request-id)}
|
cofx
|
||||||
(handle-response response-js)))
|
{:db (update-in db [:communities/requests-to-join community-id] dissoc request-id)
|
||||||
|
:dispatch-n [[:sanitize-messages-and-process-response response-js]
|
||||||
|
[:activity-center.notifications/mark-as-read request-id]]}))
|
||||||
|
|
||||||
(rf/defn accept-request-to-join-pressed
|
(rf/defn accept-request-to-join-pressed
|
||||||
{:events [:communities.ui/accept-request-to-join-pressed]}
|
{:events [:communities.ui/accept-request-to-join-pressed]}
|
||||||
|
|
|
@ -41,15 +41,11 @@
|
||||||
:type :danger
|
:type :danger
|
||||||
:on-press (fn []
|
:on-press (fn []
|
||||||
(rf/dispatch [:communities.ui/decline-request-to-join-pressed
|
(rf/dispatch [:communities.ui/decline-request-to-join-pressed
|
||||||
community-id id])
|
community-id id]))}
|
||||||
(rf/dispatch [:activity-center.notifications/mark-as-read
|
|
||||||
id]))}
|
|
||||||
:button-2 {:label (i18n/label :t/accept)
|
:button-2 {:label (i18n/label :t/accept)
|
||||||
:accessibility-label :accept-join-request
|
:accessibility-label :accept-join-request
|
||||||
:type :positive
|
:type :positive
|
||||||
:on-press (fn []
|
:on-press (fn []
|
||||||
(rf/dispatch [:communities.ui/accept-request-to-join-pressed
|
(rf/dispatch [:communities.ui/accept-request-to-join-pressed
|
||||||
community-id id])
|
community-id id]))}}
|
||||||
(rf/dispatch [:activity-center.notifications/mark-as-read
|
|
||||||
id]))}}
|
|
||||||
nil))]))
|
nil))]))
|
||||||
|
|
Loading…
Reference in New Issue