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(); }