Compare commits

...
17 Commits
6 changed files with 30 additions and 18 deletions
+1
View File
@@ -217,6 +217,7 @@ GEM
PLATFORMS
arm64-darwin-22
x86_64-darwin-22
DEPENDENCIES
activesupport (>= 6.1.7.3, < 7.1.0)
+1 -1
View File
@@ -1444,7 +1444,7 @@ SPEC CHECKSUMS:
FBLazyVector: 56e0e498dbb513b96c40bac6284729ba4e62672d
FBReactNativeSpec: 146c741a3f40361f6bc13a4ba284678cbedb5881
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 530710e7949eb12c82670bd09e946becf50a3c2a
glog: 37f1918ec8d57cbace2b409e117ef06bade68a64
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
+2
View File
@@ -488,3 +488,5 @@
(def ^:const alert-banner-height 40)
(def ^:const status-hostname "status.app")
(def ^:const community-joined-notification-type "communityJoined")
+5 -10
View File
@@ -59,16 +59,11 @@
(defn- handle-my-request
[db {:keys [community-id state deleted] :as request}]
(let [{:keys [name]} (get-in db [:communities community-id])]
(cond (and (= constants/community-request-to-join-state-pending state) (not deleted))
(assoc-in db [:communities/my-pending-requests-to-join community-id] request)
(and (= constants/community-request-to-join-state-accepted state) (not deleted))
(do (rf/dispatch [:toasts/upsert
{:id :joined-community
:type :positive
:text (i18n/label :t/joined-community {:community name})}])
(update-in db [:communities/my-pending-requests-to-join] dissoc community-id))
:else (update-in db [:communities/my-pending-requests-to-join] dissoc community-id))))
(cond (and (= constants/community-request-to-join-state-pending state) (not deleted))
(assoc-in db [:communities/my-pending-requests-to-join community-id] request)
(and (= constants/community-request-to-join-state-accepted state) (not deleted))
(update-in db [:communities/my-pending-requests-to-join] dissoc community-id)
:else (update-in db [:communities/my-pending-requests-to-join] dissoc community-id)))
(defn handle-admin-request
[db {:keys [id community-id deleted] :as request}]
@@ -2,9 +2,13 @@
(:require
[legacy.status-im.notifications.wallet :as notifications.wallet]
[react-native.platform :as platform]
[status-im.constants :as constants]
status-im.contexts.profile.push-notifications.local.effects
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(def ^:private push-notification-types
#{"transaction" "message"})
(defn foreground-chat?
[{{:keys [current-chat-id view-id]} :db} chat-id]
@@ -21,6 +25,14 @@
(or (= app-state "background")
(not (foreground-chat? cofx chat-id))))))
(defn show-community-joined-toast
[{:keys [bodyType title]}]
(when (= bodyType constants/community-joined-notification-type)
{:dispatch [:toasts/upsert
{:id :joined-community
:type :positive
:text (i18n/label :t/joined-community {:community title})}]}))
(defn create-notification
[cofx {:keys [bodyType] :as notification}]
(assoc
@@ -32,7 +44,9 @@
bodyType))
(rf/defn process
[cofx event]
(if platform/ios?
{:effects/push-notifications-local-present-ios (create-notification nil event)}
{:effects/push-notifications-local-present-android (create-notification cofx event)}))
[cofx {:keys [bodyType] :as event}]
(if (push-notification-types bodyType)
(if platform/ios?
{:effects/push-notifications-local-present-ios (create-notification nil event)}
{:effects/push-notifications-local-present-android (create-notification cofx event)})
(show-community-joined-toast event)))
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.0",
"commit-sha1": "0db27a8be6b482c3d4687909e156e38654911f88",
"src-sha256": "0qcdf90sz0y0486dsgjindanavilkh9czzijlk8r0zz867n5b896"
"version": "return-request-to-join-acceptance-notifications",
"commit-sha1": "9baadae2e5146d4c4a1fcdce162ce83f58a7ed0e",
"src-sha256": "0kpnxsnj1hqak94l9ikx8h3g1ki1wi1314hy04875wm7z9zagr03"
}