From 6722b45076ab84c3144105bce47cf5e8b3d0d552 Mon Sep 17 00:00:00 2001 From: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Date: Mon, 23 Jan 2023 16:26:58 +0530 Subject: [PATCH] [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 --- src/status_im/communities/core.cljs | 16 ++++++++++------ .../activity_center/notification/admin/view.cljs | 8 ++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index a0bd1c1f3f..32c35105a8 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -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]} diff --git a/src/status_im2/contexts/activity_center/notification/admin/view.cljs b/src/status_im2/contexts/activity_center/notification/admin/view.cljs index 89b955c273..e7cef35332 100644 --- a/src/status_im2/contexts/activity_center/notification/admin/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/admin/view.cljs @@ -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))]))