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 9, 2023
1 parent 595b1cf commit 0962255
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 36 deletions.
22 changes: 12 additions & 10 deletions src/status_im2/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,15 @@

(defn overview
[id]
(let [id (or id (rf/sub [:get-screen-params :community-overview]))
customization-color (rf/sub [:profile/customization-color])]
[rn/view {:style style/community-overview-container}
[community-card-page-view id]
[quo/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
{:position :absolute
:bottom 34}]]))
(rf/dispatch [:activity-center.notifications/dismiss-community-overview id])
(fn [id]
(let [id (or id (rf/sub [:get-screen-params :community-overview]))
customization-color (rf/sub [:profile/customization-color])]
[rn/view {:style style/community-overview-container}
[community-card-page-view id]
[quo/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
{:position :absolute
:bottom 34}]])))
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": "4a2a097dd30d533dcff37559695d7bb66c8d3e0d",
"src-sha256": "00w5hmafkxr0ni0iqjdg5r7ckpbw96fhbwc03h83bjalxqhi92cz"
}

0 comments on commit 0962255

Please sign in to comment.