Chat List: Fix new chats not appearing (#5389)

This commit is contained in:
zubiden 2024-12-31 03:14:28 +01:00 committed by Alexander Zinchuk
parent 31db2eed8f
commit f7e316f0b3
2 changed files with 4 additions and 4 deletions

View File

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

View File

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