Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix subs leak #18480

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/status_im/subs/chats.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -107,41 +107,13 @@
(fn [chats [_ chat-id]]
(get chats chat-id)))

(re-frame/reg-sub
:chats/synced-from
(fn [[_ chat-id] _]
(re-frame/subscribe [:chats/chat-by-id chat-id]))
(fn [{:keys [synced-from]}]
synced-from))

(re-frame/reg-sub
:chats/muted
(fn [[_ chat-id] _]
(re-frame/subscribe [:chats/chat-by-id chat-id]))
(fn [{:keys [muted]}]
muted))

(re-frame/reg-sub
:chats/chat-type
(fn [[_ chat-id] _]
(re-frame/subscribe [:chats/chat-by-id chat-id]))
(fn [{:keys [chat-type]}]
chat-type))

(re-frame/reg-sub
:chats/joined
(fn [[_ chat-id] _]
(re-frame/subscribe [:chats/chat-by-id chat-id]))
(fn [{:keys [joined]}]
joined))

(re-frame/reg-sub
:chats/synced-to-and-from
(fn [[_ chat-id] _]
(re-frame/subscribe [:chats/chat-by-id chat-id]))
(fn [chat]
(select-keys chat [:synced-to :synced-from])))

(re-frame/reg-sub
:chats/current-raw-chat
:<- [:chats/chats]
Expand Down
5 changes: 1 addition & 4 deletions src/status_im/subs/messages.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@
[(re-frame/subscribe [:chats/message-list chat-id])
(re-frame/subscribe [:chats/chat-messages chat-id])
(re-frame/subscribe [:chats/pinned chat-id])
(re-frame/subscribe [:chats/loading-messages? chat-id])
(re-frame/subscribe [:chats/synced-from chat-id])
(re-frame/subscribe [:chats/chat-type chat-id])
(re-frame/subscribe [:chats/joined chat-id])])
(re-frame/subscribe [:chats/loading-messages? chat-id])])
(fn [[message-list messages pin-messages loading-messages?] _]
;;TODO (perf)
(let [message-list-seq (models.message-list/->seq message-list)]
Expand Down