Skip to content

Commit

Permalink
Chat List: Fix new chats not appearing (#5389)
Browse files Browse the repository at this point in the history
  • Loading branch information
zubiden authored and Ajaxy committed Dec 31, 2024
1 parent 31db2ee commit f7e316f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/global/actions/apiUpdaters/chats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/global/actions/apiUpdaters/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

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

Expand Down

0 comments on commit f7e316f

Please sign in to comment.