[#17572] fix: 'Join Community' notification is not getting dismissed (#17834)

This commit is contained in:
Mohsen 2023-12-04 15:24:06 +03:00 committed by GitHub
parent 3cd302b271
commit a7178a4950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 27 deletions

View File

@ -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

View File

@ -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]

View File

@ -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,6 +27,10 @@
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[swipeable props
[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
@ -40,4 +45,4 @@
:size 24
:blur? true
:community-logo community-image
:community-name community-name}]]}]]))
:community-name community-name}]]}]]]))

View File

@ -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,6 +68,10 @@
{:keys [header-text context]} (get-header-text-and-context community
membership-status)]
[swipeable props
[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
@ -74,4 +79,4 @@
:on-layout set-swipeable-height
:timestamp (datetime/timestamp->relative timestamp)
:unread? (not read)
:context context}]]))
:context context}]]]))

View File

@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"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"
}