Skip to content

Commit

Permalink
Add lastOpenedAtKey for communities
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil committed Dec 31, 2023
1 parent e392608 commit 7849d8d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/status_im/contexts/communities/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
:tokenPermissions :token-permissions
:communityTokensMetadata :tokens-metadata
:introMessage :intro-message
:muteTill :muted-till})
:muteTill :muted-till
:lastOpenedAt :last-opened-at})
(update :admin-settings
set/rename-keys
{:pinMessageAllMembersEnabled :pin-message-all-members-enabled?})
Expand Down Expand Up @@ -169,6 +170,13 @@
{}
categories))}))

(rf/reg-event-fx :communities/update-last-opened-at
(fn [_ [community-id]]
{:json-rpc/call [{:method "wakuext_updateLastOpenedAt"
:params [community-id]
:on-success #(rf/dispatch [:communities/handle-community (first (:communities %))])
:on-error #(log/error (str "failed to update last opened at for community " %))}]}))

(rf/reg-event-fx :community/fetch
(fn [_]
{:json-rpc/call [{:method "wakuext_communities"
Expand Down
5 changes: 4 additions & 1 deletion src/status_im/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,17 @@
(rf/dispatch [:activity-center.notifications/dismiss-community-overview id]))
[community-scroll-page community pending?]))

(defn overview
(defn internal-overview
[id]
(let [id (or id (rf/sub [:get-screen-params :community-overview]))
customization-color (rf/sub [:profile/customization-color])]
(rn/use-effect #(rf/dispatch [:communities/update-last-opened-at id]) [id])
[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)}}
style/floating-shell-button]]))

(defn overview [id] [:f> internal-overview id])
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.39",
"commit-sha1": "debfe1cab368140b16d2383efc68007d3c28a4ef",
"src-sha256": "0cbj3796qz69ylwcvdw5jsl1cdyrcfk81d7shjkakvjh59rv5sjk"
"version": "4479",
"commit-sha1": "f619b2e71a9bd1efa9acb075cf7b5fd34b81e2e3",
"src-sha256": "0w4ayk21ws88vkrm2py87ri5gwkhxk462nvnaszgnf5spa1sxh4w"
}

0 comments on commit 7849d8d

Please sign in to comment.