Skip to content

Commit d4f515d

Browse files
committed
fix unsafe state mutation
1 parent d39a371 commit d4f515d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/components/splits/splits.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
// Sort splits by highest percentage first, with groups at the bottom always.
77
const sortList = (list: Splits) =>
8-
list.sort((a, b) => {
8+
[...list].sort((a, b) => {
99
if (a.__typename === 'SplitGroup' && b.__typename === 'SplitGroup') return 0;
1010
if (a.__typename === 'SplitGroup') return 1;
1111
if (b.__typename === 'SplitGroup') return -1;
@@ -56,7 +56,7 @@
5656
</script>
5757

5858
<ul class="splits-list" class:group={isGroup}>
59-
{#each sortedList as listItem, index}
59+
{#each sortedList as listItem, index (index)}
6060
<li class="split">
6161
<SplitComponent
6262
groupExpanded={startExpanded}

0 commit comments

Comments
 (0)