mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-21 21:01:29 +01:00
Chat List: Fix deleted chat remaining listed
This commit is contained in:
parent
1f02f2b715
commit
1bcf27cc76
@ -277,23 +277,17 @@ export async function requestChatUpdate({
|
||||
|
||||
updateLocalDb(result);
|
||||
|
||||
let lastMessage: ApiMessage | undefined;
|
||||
if (!noLastMessage) {
|
||||
const lastRemoteMessage = buildApiMessage(result.messages[0]);
|
||||
|
||||
if (lastLocalMessage && (!lastRemoteMessage || (lastLocalMessage.date > lastRemoteMessage.date))) {
|
||||
lastMessage = lastLocalMessage;
|
||||
} else {
|
||||
lastMessage = lastRemoteMessage;
|
||||
}
|
||||
}
|
||||
const lastRemoteMessage = buildApiMessage(result.messages[0]);
|
||||
const lastMessage = lastLocalMessage && (!lastRemoteMessage || (lastLocalMessage.date > lastRemoteMessage.date))
|
||||
? lastLocalMessage
|
||||
: lastRemoteMessage;
|
||||
|
||||
onUpdate({
|
||||
'@type': 'updateChat',
|
||||
id,
|
||||
chat: {
|
||||
...buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset),
|
||||
...(lastMessage && { lastMessage }),
|
||||
...(!noLastMessage && { lastMessage }),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user