diff --git a/svelte-ui/src/components/Composition.svelte b/svelte-ui/src/components/Composition.svelte index 1f4d855..72216d9 100644 --- a/svelte-ui/src/components/Composition.svelte +++ b/svelte-ui/src/components/Composition.svelte @@ -10,6 +10,7 @@ export let logs: LogResult[] = []; export let mode: GoalCompositionMode = "item"; + export let ignoreZeroWeight: boolean = false; let list: CompositionItem[] = []; @@ -20,19 +21,23 @@ for (const log of logs) { if (log.itemCounted !== false) { const item = log.item; - if (!map[item.id]) { - map[item.id] = {name: item.name, amount: log.itemAmount, link: `/items#${item.id}`}; - } else { - map[item.id].amount += log.itemAmount; + if (!ignoreZeroWeight || item.groupWeight > 0) { + if (!map[item.id]) { + map[item.id] = {name: item.name, amount: log.itemAmount, link: `/items#${item.id}`}; + } else { + map[item.id].amount += log.itemAmount; + } } } if (log.secondaryItem && log.secondaryItemCounted !== false) { const item = log.secondaryItem; - if (!map[item.id]) { - map[item.id] = {name: item.name, amount: log.secondaryItemAmount, link: `/items#${item.id}`}; - } else { - map[item.id].amount += log.secondaryItemAmount; + if (!ignoreZeroWeight || item.groupWeight > 0) { + if (!map[item.id]) { + map[item.id] = {name: item.name, amount: log.secondaryItemAmount, link: `/items#${item.id}`}; + } else { + map[item.id].amount += log.secondaryItemAmount; + } } } } diff --git a/svelte-ui/src/components/GoalEntry.svelte b/svelte-ui/src/components/GoalEntry.svelte index 2242c26..52c7849 100644 --- a/svelte-ui/src/components/GoalEntry.svelte +++ b/svelte-ui/src/components/GoalEntry.svelte @@ -49,7 +49,7 @@ - +