diff --git a/src/status_im/activity_center/core.cljs b/src/status_im/activity_center/core.cljs index 94e404aaa4..c677e16d8a 100644 --- a/src/status_im/activity_center/core.cljs +++ b/src/status_im/activity_center/core.cljs @@ -86,18 +86,23 @@ (and (some? cursor) (not= cursor start-or-end-cursor))) -(defn- filter-status->rpc-method - [filter-status] - (if (= filter-status :read) - "wakuext_readActivityCenterNotifications" - "wakuext_unreadActivityCenterNotifications")) +(def ^:const status-read 1) +(def ^:const status-unread 2) +(def ^:const status-all 3) + +(defn status [filter-status] + (case filter-status + :read status-read + :unread status-unread + :all status-all + 99)) (fx/defn notifications-fetch [{:keys [db]} {:keys [cursor filter-type filter-status reset-data?]}] (when-not (get-in db [:activity-center :notifications filter-type filter-status :loading?]) {:db (assoc-in db [:activity-center :notifications filter-type filter-status :loading?] true) - ::json-rpc/call [{:method (filter-status->rpc-method filter-status) - :params [cursor (defaults :notifications-per-page) filter-type] + ::json-rpc/call [{:method "wakuext_activityCenterNotificationsBy" + :params [cursor (defaults :notifications-per-page) filter-type (status filter-status)] :on-success #(rf/dispatch [:activity-center.notifications/fetch-success filter-type filter-status reset-data? %]) :on-error #(rf/dispatch [:activity-center.notifications/fetch-error filter-type filter-status %])}]})) diff --git a/src/status_im/activity_center/core_test.cljs b/src/status_im/activity_center/core_test.cljs index abcdc8c5fc..b0699d1e96 100644 --- a/src/status_im/activity_center/core_test.cljs +++ b/src/status_im/activity_center/core_test.cljs @@ -434,7 +434,7 @@ (rf/dispatch [:activity-center.notifications/fetch-next-page]) - (is (= "wakuext_unreadActivityCenterNotifications" (get-in @spy-queue [0 :args 0 :method]))) + (is (= "wakuext_activityCenterNotificationsBy" (get-in @spy-queue [0 :args 0 :method]))) (is (= "10" (get-in @spy-queue [0 :args 0 :params 0])) "Should be called with current cursor") (is (= {types/mention diff --git a/src/status_im/ui/screens/activity_center/views.cljs b/src/status_im/ui/screens/activity_center/views.cljs index 25f01f912f..117d783fe3 100644 --- a/src/status_im/ui/screens/activity_center/views.cljs +++ b/src/status_im/ui/screens/activity_center/views.cljs @@ -13,6 +13,7 @@ [status-im.i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.utils.datetime :as datetime] + [goog.string :as gstring] [status-im.utils.handlers :refer [evt]] [quo.components.safe-area :as safe-area])) @@ -25,6 +26,14 @@ (defmulti notification-component :type) +;; TODO(rasom): should be removed as soon as all notifications types covered +(defmethod notification-component :default + [{:keys [type]}] + [rn/view {:style {:width 300, :height 100}} + [rn/text + (gstring/format + "I exist just to avoid crashing for no reason. I'm sorry. Type %d" type)]]) + ;;;; Contact request notifications (defmethod notification-component types/contact-request @@ -135,7 +144,7 @@ :override-theme :dark :on-press #(>evt [:activity-center.notifications/fetch-first-page {:filter-status (if unread-filter-enabled? - :read + :all :unread)}])} :i/unread])) diff --git a/status-go-version.json b/status-go-version.json index a519cccd0b..7961fa723c 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "91aac3cec0c1d74f09cf8d108105ba311552723d", - "commit-sha1": "91aac3cec0c1d74f09cf8d108105ba311552723d", - "src-sha256": "0j9vl7alb4rf3zk0bak12s3bdfwgih4fq9yaw7wkinmz03rqx2wg" + "version": "v0.114.3", + "commit-sha1": "7662cd613a9d8bdda4927e583c429b362e3d3815", + "src-sha256": "1ldlwhpwdwjxkx9imjinzcw3x5a6wcs70w13kypsfaf4hv17ipmb" }