Fix card duplication on type change

This commit is contained in:
regalijan 2023-10-19 16:51:06 -04:00
parent 3082f145e6
commit 6c310e5564
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -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}`,
@ -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 &&
@ -267,7 +268,6 @@ export default function () {
const ItemDisplay = (
<Select
onChange={async (v) => {
setEntries([]);
setBefore(Date.now());
const { target } = v;
@ -275,6 +275,9 @@ export default function () {
await updateQueue(
target.options[target.selectedIndex].value,
Date.now(),
false,
false,
false,
);
}}
>