Skip to content

Commit

Permalink
fix edge case comm ticket total
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed Dec 10, 2023
1 parent 20c9b05 commit 60d7539
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/routes/community/[area]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,24 @@
let showType = 'Add';
const tickets = data.tickets;
const totalTickets = tickets.length;
const ticketError = tickets === 'error' ? true : false;
$: ticketError && errToast('Could not load open tickets, please try again or contact BTC Map.');
const add =
tickets &&
tickets.length &&
!ticketError &&
tickets.filter((issue: any) =>
issue.labels.find((label: any) => label.name === 'location-submission')
);
tickets && tickets.length && !ticketError
? tickets.filter((issue: any) =>
issue.labels.find((label: any) => label.name === 'location-submission')
)
: [];
const verify =
tickets &&
tickets.length &&
!ticketError &&
tickets.filter((issue: any) =>
issue.labels.find((label: any) => label.name === 'verify-submission')
);
tickets && tickets.length && !ticketError
? tickets.filter((issue: any) =>
issue.labels.find((label: any) => label.name === 'verify-submission')
)
: [];
const totalTickets = add.length + verify.length;
let avatar = community?.['icon:square'];
let name = data.name;
Expand Down

0 comments on commit 60d7539

Please sign in to comment.