From 184f126b50121954c9416e962fe2b0987a0ef572 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Thu, 29 Jun 2023 22:11:02 +0500 Subject: [PATCH] UBER-509: do not update list of unread right after reading (#3461) Signed-off-by: Vyacheslav Tumanov --- plugins/notification-resources/src/components/Activity.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/notification-resources/src/components/Activity.svelte b/plugins/notification-resources/src/components/Activity.svelte index 67fd103354..b58dbbaf7c 100644 --- a/plugins/notification-resources/src/components/Activity.svelte +++ b/plugins/notification-resources/src/components/Activity.svelte @@ -32,6 +32,7 @@ let docs: DocUpdates[] = [] let filtered: DocUpdates[] = [] let loading = true + let previousFilter: 'all' | 'read' | 'unread' = filter $: query.query( notification.class.DocUpdates, @@ -55,10 +56,11 @@ if (filter === 'read') { filtered = docs.filter((p) => !p.txes.some((p) => p.isNew) && p.txes.length > 0) } else if (filter === 'unread') { - filtered = docs.filter((p) => p.txes.some((p) => p.isNew) && p.txes.length > 0) + if (previousFilter !== 'unread') filtered = docs.filter((p) => p.txes.some((p) => p.isNew) && p.txes.length > 0) } else { filtered = docs.filter((p) => p.txes.length > 0) } + previousFilter = filter listProvider.update(filtered) if (_id === undefined) { changeSelected(selected)