From 4165565956d29e2634a9591b8cd9c7b8ca192bf0 Mon Sep 17 00:00:00 2001 From: flexsurfer Date: Fri, 12 Jan 2024 16:12:10 +0100 Subject: [PATCH] fix subs leak (#18480) --- src/status_im/subs/chats.cljs | 28 ---------------------------- src/status_im/subs/messages.cljs | 5 +---- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/status_im/subs/chats.cljs b/src/status_im/subs/chats.cljs index 0a7d6cbde5..c19a4c09c0 100644 --- a/src/status_im/subs/chats.cljs +++ b/src/status_im/subs/chats.cljs @@ -107,13 +107,6 @@ (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] _] @@ -121,27 +114,6 @@ (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] diff --git a/src/status_im/subs/messages.cljs b/src/status_im/subs/messages.cljs index 264dce844f..2283f92095 100644 --- a/src/status_im/subs/messages.cljs +++ b/src/status_im/subs/messages.cljs @@ -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)]