Fix card duplication on type change
This commit is contained in:
parent
3082f145e6
commit
6c310e5564
@ -129,6 +129,7 @@ export default function () {
|
|||||||
before: number,
|
before: number,
|
||||||
show_closed = false,
|
show_closed = false,
|
||||||
jump_item_to_top = false,
|
jump_item_to_top = false,
|
||||||
|
clear_all_others = false,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const queueReq = await fetch(
|
const queueReq = await fetch(
|
||||||
`/api/mod-queue/list?before=${before}&showClosed=${show_closed}&type=${queue_type}`,
|
`/api/mod-queue/list?before=${before}&showClosed=${show_closed}&type=${queue_type}`,
|
||||||
@ -153,7 +154,7 @@ export default function () {
|
|||||||
const itemType = searchParams.get("type");
|
const itemType = searchParams.get("type");
|
||||||
|
|
||||||
let entryData: { [k: string]: any }[] = await queueReq.json();
|
let entryData: { [k: string]: any }[] = await queueReq.json();
|
||||||
const newEntries = [...entries];
|
const newEntries = clear_all_others ? [] : [...entries];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
itemId &&
|
itemId &&
|
||||||
@ -267,7 +268,6 @@ export default function () {
|
|||||||
const ItemDisplay = (
|
const ItemDisplay = (
|
||||||
<Select
|
<Select
|
||||||
onChange={async (v) => {
|
onChange={async (v) => {
|
||||||
setEntries([]);
|
|
||||||
setBefore(Date.now());
|
setBefore(Date.now());
|
||||||
|
|
||||||
const { target } = v;
|
const { target } = v;
|
||||||
@ -275,6 +275,9 @@ export default function () {
|
|||||||
await updateQueue(
|
await updateQueue(
|
||||||
target.options[target.selectedIndex].value,
|
target.options[target.selectedIndex].value,
|
||||||
Date.now(),
|
Date.now(),
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user