diff --git a/svelte-ui/src/components/Composition.svelte b/svelte-ui/src/components/Composition.svelte index 97a19d1..da360ea 100644 --- a/svelte-ui/src/components/Composition.svelte +++ b/svelte-ui/src/components/Composition.svelte @@ -16,6 +16,7 @@ export let ignoreZeroWeight: boolean = false; let list: CompositionItem[] = []; + let allOnes: boolean = false; function calculateAmount(log: LogResult, unweighted: boolean) { let amount = 0; @@ -83,12 +84,16 @@ list = Object.keys(map).sort((a, b) => map[b].amount - map[a].amount).map(k => map[k]).filter(e => e.amount > 0); } + + $: allOnes = list.find(l => l.amount !== 1) == null;
{#each list as item}
- {item.amount}x  + {#if !allOnes} + {item.amount}x  + {/if} {item.name}
{/each} @@ -102,7 +107,7 @@ } div.item { - padding: 0.125em 0.5ch; + padding: 0.125em 0.75ch; display: inline-block; }