From d585d4eeb736453a02a7f82172d556b5168cc548 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 28 Dec 2022 17:21:58 +0100 Subject: [PATCH] fix: deduplicate incoming statuses --- composables/paginator.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composables/paginator.ts b/composables/paginator.ts index 1b665649..7daef178 100644 --- a/composables/paginator.ts +++ b/composables/paginator.ts @@ -28,6 +28,10 @@ export function usePaginator( if ('uri' in status) cacheStatus(status, undefined, true) + const index = prevItems.value.findIndex((i: any) => i.id === status.id) + if (index >= 0) + prevItems.value.splice(index, 1) + prevItems.value.unshift(status as any) })