Chat List: Fix removing empty chats after deletion (#1253)
This commit is contained in:
parent
a877d6e497
commit
e4b5b81de1
@ -267,9 +267,14 @@ addReducer('apiUpdate', (global, actions, update: ApiUpdate) => {
|
|||||||
|
|
||||||
case 'deleteHistory': {
|
case 'deleteHistory': {
|
||||||
const { chatId } = update;
|
const { chatId } = update;
|
||||||
const ids = Object.keys(global.messages.byChatId[chatId].byId).map(Number);
|
const chatMessages = global.messages.byChatId[chatId];
|
||||||
|
if (chatMessages) {
|
||||||
|
const ids = Object.keys(chatMessages.byId).map(Number);
|
||||||
|
deleteMessages(chatId, ids, actions, global);
|
||||||
|
} else {
|
||||||
|
actions.requestChatUpdate({ chatId });
|
||||||
|
}
|
||||||
|
|
||||||
deleteMessages(chatId, ids, actions, global);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user