Skip to content

Commit

Permalink
feat: no loading sequence when there are announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Jun 25, 2024
1 parent 5909fb8 commit 9f0a3f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/AccountReceiveTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,9 @@ function useReceivedFundsTable(userAnnouncements: Ref<UserAnnouncement[]>, spend

// eslint-disable-next-line @typescript-eslint/no-misused-promises
watchEffect(async () => {
if (userAnnouncements.value.length === 0) formattedAnnouncements.value = [];
isLoading.value = true;
const hasAnnouncements = userAnnouncements.value.length > 0;
if (!hasAnnouncements) formattedAnnouncements.value = [];
isLoading.value = !hasAnnouncements;
const announcements = userAnnouncements.value as ReceiveTableAnnouncement[];
const newAnnouncements = announcements.filter((x) => !formattedAnnouncements.value.includes(x));
formattedAnnouncements.value = sortByTimestamp([...formattedAnnouncements.value, ...newAnnouncements]);
Expand Down

0 comments on commit 9f0a3f9

Please sign in to comment.