Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bef8b0bad | ||
|
|
c5ff85ee00 | ||
|
|
b8237912af | ||
|
|
2f0bc05f3f | ||
|
|
f98af1061c | ||
|
|
962fba3999 | ||
|
|
38264d606e | ||
|
|
0cbb257cf8 | ||
|
|
e97f2bbbe4 | ||
|
|
d5c0c4d6d8 | ||
|
|
e994d145d9 | ||
|
|
72a32347a5 | ||
|
|
e2e8f44c7a | ||
|
|
5efee3b688 | ||
|
|
0cddd3765b | ||
|
|
f197c3a264 | ||
|
|
9f77d903ad |
@@ -217,6 +217,7 @@ GEM
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin-22
|
||||
x86_64-darwin-22
|
||||
|
||||
DEPENDENCIES
|
||||
activesupport (>= 6.1.7.3, < 7.1.0)
|
||||
|
||||
+1
-1
@@ -1444,7 +1444,7 @@ SPEC CHECKSUMS:
|
||||
FBLazyVector: 56e0e498dbb513b96c40bac6284729ba4e62672d
|
||||
FBReactNativeSpec: 146c741a3f40361f6bc13a4ba284678cbedb5881
|
||||
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
||||
glog: 530710e7949eb12c82670bd09e946becf50a3c2a
|
||||
glog: 37f1918ec8d57cbace2b409e117ef06bade68a64
|
||||
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
|
||||
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
|
||||
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
|
||||
|
||||
@@ -488,3 +488,5 @@
|
||||
(def ^:const alert-banner-height 40)
|
||||
|
||||
(def ^:const status-hostname "status.app")
|
||||
|
||||
(def ^:const community-joined-notification-type "communityJoined")
|
||||
|
||||
@@ -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,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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user