added no dupe for lootbox
This commit is contained in:
parent
47f4ee6464
commit
6a1b9ef890
|
|
@ -147,9 +147,11 @@ export const userController = createController({
|
||||||
if (!lootbox) {
|
if (!lootbox) {
|
||||||
throw new Error("Lootbox not found");
|
throw new Error("Lootbox not found");
|
||||||
}
|
}
|
||||||
const itemsCopy = [...lootbox.items];
|
let itemsCopy = [...lootbox.items];
|
||||||
if (lootbox.noDuplicates) {
|
if (lootbox.noDuplicates) {
|
||||||
itemsCopy.filter((i) => !collection.entries.some((e) => e.id === i.id));
|
itemsCopy = itemsCopy.filter(
|
||||||
|
(i) => !collection.entries.some((e) => e.id === i.id),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (itemsCopy.length === 0) {
|
if (itemsCopy.length === 0) {
|
||||||
throw new Error("No items left");
|
throw new Error("No items left");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue