Skip to content

Commit

Permalink
[#17572] fix: 'Join Community' notification is not getting dismissed
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Nov 30, 2023
1 parent ed270b2 commit c5ff645
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/status_im2/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/status_im2/contexts/shell/activity_center/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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}]]}]]]))
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -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}]]]))
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.171.11",
"commit-sha1": "8a4c2d8d2f17117aa0a00338e83b0f753ebf1328",
"src-sha256": "160qnl9dsl1ypvqg9w6z8wps4fvgq3qxi16piymhrlzgssdwkz8h"
"version": "fix/join-community-notification",
"commit-sha1": "9915e7b206f870fcc75e0954c85931f0640179e8",
"src-sha256": "1r08y0n640da7y3g0p524rjgz73sj5vfd368kj56lgzwpnj8cipi"
}

0 comments on commit c5ff645

Please sign in to comment.