Skip to content

Commit

Permalink
fix: deduplicate incoming statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 28, 2022
1 parent 34dc2f7 commit d585d4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions composables/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export function usePaginator<T>(
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)
})

Expand Down

0 comments on commit d585d4e

Please sign in to comment.