fix: remove unfollowed threads
This commit is contained in:
parent
a9abf322c4
commit
12989f8f30
|
@ -429,9 +429,13 @@ class ThreadMessagesView extends React.Component<IThreadMessagesViewProps, IThre
|
||||||
};
|
};
|
||||||
|
|
||||||
toggleFollowThread = async (isFollowingThread: boolean, tmid: string) => {
|
toggleFollowThread = async (isFollowingThread: boolean, tmid: string) => {
|
||||||
|
const { displayingThreads, currentFilter } = this.state;
|
||||||
try {
|
try {
|
||||||
await Services.toggleFollowMessage(tmid, !isFollowingThread);
|
await Services.toggleFollowMessage(tmid, !isFollowingThread);
|
||||||
EventEmitter.emit(LISTENER, { message: isFollowingThread ? I18n.t('Unfollowed_thread') : I18n.t('Following_thread') });
|
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) {
|
} catch (e) {
|
||||||
log(e);
|
log(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue