Fix multiple channel read while data is updating (#5576)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-05-10 19:13:01 +04:00 committed by GitHub
parent b65dbd2d58
commit 77a8b2ce3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -390,6 +390,7 @@ export async function readChannelMessages (
const lastTimestamp = messages[messages.length - 1].createdOn ?? 0
if ((context.lastViewedTimestamp ?? 0) < lastTimestamp) {
context.lastViewedTimestamp = lastTimestamp
void client.update(context, { lastViewedTimestamp: lastTimestamp })
}
}