mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Chat List: Fix not loading some chats
This commit is contained in:
parent
f811726d27
commit
6751813049
@ -75,29 +75,27 @@ export async function fetchChats({
|
||||
return undefined;
|
||||
}
|
||||
|
||||
updateLocalDb(result);
|
||||
|
||||
if (resultPinned) {
|
||||
updateLocalDb(resultPinned);
|
||||
}
|
||||
updateLocalDb(result);
|
||||
|
||||
const lastMessagesByChatId = buildCollectionByKey(
|
||||
[...result.messages, ...(resultPinned ? resultPinned.messages : [])]
|
||||
(resultPinned ? resultPinned.messages : []).concat(result.messages)
|
||||
.map(buildApiMessage)
|
||||
.filter<ApiMessage>(Boolean as any),
|
||||
'chatId',
|
||||
);
|
||||
const peersByKey: Record<string, GramJs.TypeChat | GramJs.TypeUser> = {
|
||||
...preparePeers(result),
|
||||
...(resultPinned && preparePeers(resultPinned)),
|
||||
...preparePeers(result),
|
||||
};
|
||||
const chats: ApiChat[] = [];
|
||||
const draftsById: Record<number, ApiFormattedText> = {};
|
||||
const replyingToById: Record<number, number> = {};
|
||||
|
||||
const dialogs = [
|
||||
...(resultPinned ? resultPinned.dialogs : []),
|
||||
...result.dialogs,
|
||||
];
|
||||
const dialogs = (resultPinned ? resultPinned.dialogs : []).concat(result.dialogs);
|
||||
|
||||
const orderedPinnedIds: number[] = [];
|
||||
|
||||
@ -131,7 +129,7 @@ export async function fetchChats({
|
||||
}
|
||||
});
|
||||
|
||||
const users = [...result.users, ...(resultPinned ? resultPinned.users : [])]
|
||||
const users = (resultPinned ? resultPinned.users : []).concat(result.users)
|
||||
.map(buildApiUser)
|
||||
.filter<ApiUser>(Boolean as any);
|
||||
const chatIds = chats.map((chat) => chat.id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user