Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix card duplication on type change
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 3082f14 commit 6c310e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/routes/mod-queue.tsx
Expand Up @@ -129,6 +129,7 @@ export default function () {
before: number,
show_closed = false,
jump_item_to_top = false,
clear_all_others = false,
): Promise<void> {
const queueReq = await fetch(
`/api/mod-queue/list?before=${before}&showClosed=${show_closed}&type=${queue_type}`,
Expand All @@ -153,7 +154,7 @@ export default function () {
const itemType = searchParams.get("type");

let entryData: { [k: string]: any }[] = await queueReq.json();
const newEntries = [...entries];
const newEntries = clear_all_others ? [] : [...entries];

if (
itemId &&
Expand Down Expand Up @@ -267,14 +268,16 @@ export default function () {
const ItemDisplay = (
<Select
onChange={async (v) => {
setEntries([]);
setBefore(Date.now());

const { target } = v;

await updateQueue(
target.options[target.selectedIndex].value,
Date.now(),
false,
false,
false,
);
}}
>
Expand Down

0 comments on commit 6c310e5

Please sign in to comment.