[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:
Mohamed Javid 2023-01-23 16:26:58 +05:30 committed by GitHub
parent 897a5eb201
commit 6722b45076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -558,16 +558,20 @@
(rf/defn request-to-join-accepted
{:events [::request-to-join-accepted]}
[{:keys [db] :as cofx} community-id request-id response-js]
(rf/merge cofx
{:db (update-in db [:communities/requests-to-join community-id] dissoc request-id)}
(handle-response response-js)))
(rf/merge
cofx
{: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
{:events [::request-to-join-declined]}
[{:keys [db] :as cofx} community-id request-id response-js]
(rf/merge cofx
{:db (update-in db [:communities/requests-to-join community-id] dissoc request-id)}
(handle-response response-js)))
(rf/merge
cofx
{: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
{:events [:communities.ui/accept-request-to-join-pressed]}

View File

@ -41,15 +41,11 @@
:type :danger
:on-press (fn []
(rf/dispatch [:communities.ui/decline-request-to-join-pressed
community-id id])
(rf/dispatch [:activity-center.notifications/mark-as-read
id]))}
community-id id]))}
:button-2 {:label (i18n/label :t/accept)
:accessibility-label :accept-join-request
:type :positive
:on-press (fn []
(rf/dispatch [:communities.ui/accept-request-to-join-pressed
community-id id])
(rf/dispatch [:activity-center.notifications/mark-as-read
id]))}}
community-id id]))}}
nil))]))