From 95a6f2c64767ba596b8259461b6d5a679839c8e7 Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:22:33 -0700 Subject: [PATCH] fix(pos-dashboard): fix the history page (#14535) --- .../src/components/Events/History.svelte | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/packages/pos-dashboard/src/components/Events/History.svelte b/packages/pos-dashboard/src/components/Events/History.svelte index 8a2f2fe0fd..a9a4d22aab 100644 --- a/packages/pos-dashboard/src/components/Events/History.svelte +++ b/packages/pos-dashboard/src/components/Events/History.svelte @@ -25,11 +25,16 @@ pageSize: number, allEvents: APIResponseEvent[], ) { - if (!allEvents) return []; - const start = (page - 1) * pageSize; - const end = start + pageSize; - const ret = allEvents.slice(start, end); - return ret; + loading = true; + try { + if (!allEvents) return []; + const start = (page - 1) * pageSize; + const end = start + pageSize; + const ret = allEvents.slice(start, end); + return ret; + } finally { + loading = false; + } } const tabs = [ @@ -42,6 +47,7 @@ ]; async function getEvents(signer: ethers.Signer, activeTab: string) { + loading = true; let items = []; if (!signer) return []; @@ -82,21 +88,24 @@