diff --git a/src/components/overview/ListView.vue b/src/components/overview/ListView.vue index a7ba069..e25c978 100644 --- a/src/components/overview/ListView.vue +++ b/src/components/overview/ListView.vue @@ -99,7 +99,12 @@ export default defineComponent({ const start = new Date(); if (index < 0) { const { result } = await store.getEvents({ to: start, limit: 5, descending: true }); - events.value.unshift(...result); + //events.value.unshift(...result); + for (const event of result) { + const idx = events.value.findIndex((e) => e.id === event.id); + if (idx === -1) events.value.unshift(event); + else events.value[idx] = event; + } if (done) done(false); } else { const len = events.value.length; @@ -108,7 +113,12 @@ export default defineComponent({ offset: (index - 1) * 10, limit: 10, }); - if (len == events.value.push(...result)) { + for (const event of result) { + const idx = events.value.findIndex((e) => e.id === event.id); + if (idx === -1) events.value.unshift(event); + else events.value[idx] = event; + } + if (len == events.value.length) { if (done) return done(true); } else if (done) done(false); }