Skip to content

Commit c55ea2e

Browse files
fix(web): duplicate result warnings in results table
setAnalysisResults is called for each incoming result with all accumulated results. Since seqNameDuplicatesAtom was never cleared, the same index was appended repeatedly, causing false duplicate warnings in the UI. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5b24411 commit c55ea2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/nextclade-web/src/state/results.state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-void */
22
import type { AuspiceJsonV2, CladeNodeAttrDesc } from 'auspice'
3-
import { isNil } from 'lodash'
3+
import { isNil, union } from 'lodash'
44
import { atom, selectorFamily } from 'recoil'
55
import { atom as jotaiAtom } from 'jotai'
66
import { atomFamily as jotaiAtomFamily } from 'jotai/utils'
@@ -65,7 +65,7 @@ export const analysisResultAtom = jotaiAtomFamily((index: number) =>
6565

6666
// Add to the duplicate names map
6767
const currentDuplicates = get(seqNameDuplicatesAtom(result.seqName))
68-
set(seqNameDuplicatesAtom(result.seqName), [...currentDuplicates, result.index])
68+
set(seqNameDuplicatesAtom(result.seqName), union(currentDuplicates, [result.index]))
6969
},
7070
),
7171
)

0 commit comments

Comments
 (0)