Remove key caching from Timeline

This commit is contained in:
Fedor Indutny 2021-09-28 11:32:54 -07:00 committed by GitHub
parent 1303fd009e
commit 2f7226e200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View file

@ -2328,13 +2328,6 @@ export function reducer(
? existingConversation.resetCounter + 1
: 0;
const sorted = orderBy(
messages,
['received_at', 'sent_at'],
['ASC', 'ASC']
);
const messageIds = sorted.map(message => message.id);
const lookup = fromPairs(messages.map(message => [message.id, message]));
let { newest, oldest } = metrics;
@ -2355,6 +2348,13 @@ export function reducer(
}
}
const sorted = orderBy(
values(lookup),
['received_at', 'sent_at'],
['ASC', 'ASC']
);
const messageIds = sorted.map(message => message.id);
return {
...state,
selectedMessage: scrollToMessageId,