From a7178a4950e82efc8190bcc71aed454e6f065d4f Mon Sep 17 00:00:00 2001 From: Mohsen Date: Mon, 4 Dec 2023 15:24:06 +0300 Subject: [PATCH] [#17572] fix: 'Join Community' notification is not getting dismissed (#17834) --- .../contexts/communities/overview/view.cljs | 4 ++- .../shell/activity_center/events.cljs | 6 ++++ .../notification/community_kicked/view.cljs | 35 +++++++++++-------- .../notification/community_request/view.cljs | 21 ++++++----- status-go-version.json | 6 ++-- 5 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/status_im2/contexts/communities/overview/view.cljs b/src/status_im2/contexts/communities/overview/view.cljs index e164007c0aa..0bc3c40eb5b 100644 --- a/src/status_im2/contexts/communities/overview/view.cljs +++ b/src/status_im2/contexts/communities/overview/view.cljs @@ -366,9 +366,11 @@ (defn community-card-page-view [id] - (let [{:keys [id] + (let [{:keys [id joined] :as community} (rf/sub [:communities/community id]) pending? (rf/sub [:communities/my-pending-request-to-join id])] + (when joined + (rf/dispatch [:activity-center.notifications/dismiss-community-overview id])) [community-scroll-page community pending?])) (defn overview diff --git a/src/status_im2/contexts/shell/activity_center/events.cljs b/src/status_im2/contexts/shell/activity_center/events.cljs index ab1db10fb2b..e0274d66485 100644 --- a/src/status_im2/contexts/shell/activity_center/events.cljs +++ b/src/status_im2/contexts/shell/activity_center/events.cljs @@ -202,6 +202,12 @@ :utils/dispatch-later [{:dispatch [:activity-center.notifications/mark-all-as-read] :ms undo-time-limit-ms}]})) +(re-frame/reg-event-fx :activity-center.notifications/dismiss-community-overview + (fn [_ [community-id]] + {:json-rpc/call [{:method "wakuext_dismissActivityCenterNotificationsByCommunity" + :params [{:communityId community-id}] + :on-success [:activity-center.notifications/fetch-unread-count]}]})) + (rf/defn accept-notification {:events [:activity-center.notifications/accept]} [{:keys [db]} notification-id] diff --git a/src/status_im2/contexts/shell/activity_center/notification/community_kicked/view.cljs b/src/status_im2/contexts/shell/activity_center/notification/community_kicked/view.cljs index c09c027b13d..2584ce48a26 100644 --- a/src/status_im2/contexts/shell/activity_center/notification/community_kicked/view.cljs +++ b/src/status_im2/contexts/shell/activity_center/notification/community_kicked/view.cljs @@ -1,6 +1,7 @@ (ns status-im2.contexts.shell.activity-center.notification.community-kicked.view (:require [quo.core :as quo] + [react-native.gesture :as gesture] [status-im2.contexts.shell.activity-center.notification.common.style :as common-style] [status-im2.contexts.shell.activity-center.notification.common.view :as common] [utils.datetime :as datetime] @@ -26,18 +27,22 @@ community-name (:name community) community-image (get-in community [:images :thumbnail :uri])] [swipeable props - [quo/activity-log - {:title (i18n/label :t/community-kicked-heading) - :customization-color customization-color - :icon :i/placeholder - :on-layout set-swipeable-height - :timestamp (datetime/timestamp->relative timestamp) - :unread? (not read) - :context [[quo/text {:style common-style/user-avatar-tag-text} - (i18n/label :t/community-kicked-body)] - [quo/context-tag - {:type :community - :size 24 - :blur? true - :community-logo community-image - :community-name community-name}]]}]])) + [gesture/touchable-without-feedback + {:on-press (fn [] + (rf/dispatch [:navigate-back]) + (rf/dispatch [:activity-center.notifications/mark-as-read (:id notification)]))} + [quo/activity-log + {:title (i18n/label :t/community-kicked-heading) + :customization-color customization-color + :icon :i/placeholder + :on-layout set-swipeable-height + :timestamp (datetime/timestamp->relative timestamp) + :unread? (not read) + :context [[quo/text {:style common-style/user-avatar-tag-text} + (i18n/label :t/community-kicked-body)] + [quo/context-tag + {:type :community + :size 24 + :blur? true + :community-logo community-image + :community-name community-name}]]}]]])) diff --git a/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs b/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs index db17dd05607..b14ffc93082 100644 --- a/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs +++ b/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs @@ -1,6 +1,7 @@ (ns status-im2.contexts.shell.activity-center.notification.community-request.view (:require [quo.core :as quo] + [react-native.gesture :as gesture] [status-im2.constants :as constants] [status-im2.contexts.shell.activity-center.notification.common.style :as common-style] [status-im2.contexts.shell.activity-center.notification.common.view :as common] @@ -67,11 +68,15 @@ {:keys [header-text context]} (get-header-text-and-context community membership-status)] [swipeable props - [quo/activity-log - {:title header-text - :customization-color customization-color - :icon :i/communities - :on-layout set-swipeable-height - :timestamp (datetime/timestamp->relative timestamp) - :unread? (not read) - :context context}]])) + [gesture/touchable-without-feedback + {:on-press (fn [] + (rf/dispatch [:navigate-back]) + (rf/dispatch [:navigate-to :community-overview community-id]))} + [quo/activity-log + {:title header-text + :customization-color customization-color + :icon :i/communities + :on-layout set-swipeable-height + :timestamp (datetime/timestamp->relative timestamp) + :unread? (not read) + :context context}]]])) diff --git a/status-go-version.json b/status-go-version.json index 7c6e1db2f2e..6607cf86c8f 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.171.26", - "commit-sha1": "d92284edcee9f2af5d7f34644796fa5492892720", - "src-sha256": "0gjnw0jcwj37a5hmvhc56dm29dcyargmjb0bz9bdbdhdrsjfw9yp" + "version": "v0.171.27", + "commit-sha1": "76b6745666b945f8d6336e2a5fc6e5705985273d", + "src-sha256": "1amak99bpsx6j8grzm2kzwd3si34gg4r8kbxqmnkfsrkm2nzvbx1" }