Do not save typingStatus in cache

This commit is contained in:
Alexander Zinchuk 2023-05-28 14:32:50 +02:00
parent f1eec4e726
commit 5036627673

View File

@ -561,11 +561,12 @@ function reduceMessages<T extends GlobalState>(global: T): GlobalState['messages
? Object.values(chat.topics).map(({ lastMessageId }) => lastMessageId) : []; ? Object.values(chat.topics).map(({ lastMessageId }) => lastMessageId) : [];
const byId = pick(current.byId, viewportIdsToSave.concat(lastMessageIdsToSave)); const byId = pick(current.byId, viewportIdsToSave.concat(lastMessageIdsToSave));
const threadsById = Object.keys(threadsToSave).reduce((acc, key) => { const threadsById = Object.keys(threadsToSave).reduce((acc, key) => {
const t = threadsToSave[Number(key)]; const thread = threadsToSave[Number(key)];
acc[Number(key)] = { acc[Number(key)] = {
...t, ...thread,
listedIds: t.lastViewportIds, listedIds: thread.lastViewportIds,
pinnedIds: undefined, pinnedIds: undefined,
typingStatus: undefined,
}; };
return acc; return acc;
}, {} as GlobalState['messages']['byChatId'][string]['threadsById']); }, {} as GlobalState['messages']['byChatId'][string]['threadsById']);