From 0ae4e9b44849a35d0d200cbc6522fb3ae4028f08 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Mon, 4 Nov 2024 08:16:13 +0000 Subject: [PATCH] better note deduplication --- src/components/ticketmodal.tsx | 6 +++--- src/components/userLookup.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ticketmodal.tsx b/src/components/ticketmodal.tsx index 2e92a61..7759c6b 100644 --- a/src/components/ticketmodal.tsx +++ b/src/components/ticketmodal.tsx @@ -32,11 +32,11 @@ export const TicketModal: React.FC = ( const nav = useNavigate(); - const distinctNums: number[] = []; + const distinctNums: string[] = []; let distinctTickets: Ticket[] = []; tickets.forEach((ticket) => { - if (distinctNums.includes(ticket.ticket)) return; - distinctNums.push(ticket.ticket); + if (distinctNums.includes(`${ticket.roundId}-${ticket.ticket}`)) return; + distinctNums.push(`${ticket.roundId}-${ticket.ticket}`); distinctTickets.push(ticket); }); diff --git a/src/components/userLookup.tsx b/src/components/userLookup.tsx index e1246f1..74b1b3b 100644 --- a/src/components/userLookup.tsx +++ b/src/components/userLookup.tsx @@ -439,7 +439,7 @@ const UserTickets = (props: { ckey: string }) => { if (page == 1) { setErrored(true); } else { - setPage(1); + setPage(page - 1); } return; }