added no dupe for lootbox
This commit is contained in:
parent
47f4ee6464
commit
6a1b9ef890
|
|
@ -147,9 +147,11 @@ export const userController = createController({
|
|||
if (!lootbox) {
|
||||
throw new Error("Lootbox not found");
|
||||
}
|
||||
const itemsCopy = [...lootbox.items];
|
||||
let itemsCopy = [...lootbox.items];
|
||||
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) {
|
||||
throw new Error("No items left");
|
||||
|
|
|
|||
Loading…
Reference in New Issue