From f7e316f0b35461ca237997fe4c1357980f47b9ad Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Tue, 31 Dec 2024 03:14:28 +0100 Subject: [PATCH] Chat List: Fix new chats not appearing (#5389) --- src/global/actions/apiUpdaters/chats.ts | 4 ++-- src/global/actions/apiUpdaters/messages.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/global/actions/apiUpdaters/chats.ts b/src/global/actions/apiUpdaters/chats.ts index 0e6175ecf..90ee2f8aa 100644 --- a/src/global/actions/apiUpdaters/chats.ts +++ b/src/global/actions/apiUpdaters/chats.ts @@ -67,8 +67,8 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => { setGlobal(global); const updatedChat = selectChat(global, update.id); - if (!update.noTopChatsRequest && updatedChat && !selectIsChatListed(global, update.id) - && !updatedChat.isNotJoined) { + if (!update.noTopChatsRequest && !selectIsChatListed(global, update.id) + && !updatedChat?.isNotJoined) { // Reload top chats to update chat listing actions.loadTopChats(); } diff --git a/src/global/actions/apiUpdaters/messages.ts b/src/global/actions/apiUpdaters/messages.ts index bc8162730..88c9a3a6f 100644 --- a/src/global/actions/apiUpdaters/messages.ts +++ b/src/global/actions/apiUpdaters/messages.ts @@ -166,7 +166,7 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => { setGlobal(global); // Reload dialogs if chat is not present in the list - if (!isLocal && chat && !chat.isNotJoined && !selectIsChatListed(global, chatId)) { + if (!isLocal && !chat?.isNotJoined && !selectIsChatListed(global, chatId)) { actions.loadTopChats(); } @@ -446,7 +446,7 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => { const chat = selectChat(global, chatId); // Reload dialogs if chat is not present in the list - if (chat && !chat.isNotJoined && !selectIsChatListed(global, chatId)) { + if (!chat?.isNotJoined && !selectIsChatListed(global, chatId)) { actions.loadTopChats(); }