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 22:13:01 +07:00
committed by GitHub
parent b65dbd2d58
commit 77a8b2ce3e
+1
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 })
}
}