From 12989f8f30d32e3a50fe01cd8d7f4ca1c029e380 Mon Sep 17 00:00:00 2001 From: Sanjay Sargam Date: Sun, 21 Jan 2024 18:09:26 +0530 Subject: [PATCH] fix: remove unfollowed threads --- app/views/ThreadMessagesView/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/ThreadMessagesView/index.tsx b/app/views/ThreadMessagesView/index.tsx index 91e620c5d..7153b90bd 100644 --- a/app/views/ThreadMessagesView/index.tsx +++ b/app/views/ThreadMessagesView/index.tsx @@ -429,9 +429,13 @@ class ThreadMessagesView extends React.Component { + const { displayingThreads, currentFilter } = this.state; try { await Services.toggleFollowMessage(tmid, !isFollowingThread); EventEmitter.emit(LISTENER, { message: isFollowingThread ? I18n.t('Unfollowed_thread') : I18n.t('Following_thread') }); + if (currentFilter === Filter.Following) { + this.setState({ displayingThreads: displayingThreads.filter(thread => thread.id !== tmid) }); + } } catch (e) { log(e); }