Skip to content

Commit 29b8a35

Browse files
fix(web): update current dataset when remote pathogen.json changes
Resolves #1450 This removes dataset path equality check preventing dataset object from being updated. The older dataset object version from local storage will then be used. I don't remember why this check was needed. It seems overwriting current dataset is fine whether it's equal (by path or before paths were a thing using name/ref/tag). Hopefully this does not bring any undesired effects. I consider this a short-term fix. A proper solution should probably remove storing dataset object in the local storage, but only storing a dataset identifier there. But ti's more involved and we need to figure out what generally identifies a dataset (dataset path, alright, but we can also have the same path on different dataset servers as well as single datasets not belonging to any server).
1 parent 2e631d8 commit 29b8a35

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { autodetectResultsAtom } from 'src/state/autodetect.state'
44
import type { Dataset, MinimizerIndexVersion } from 'src/types'
55
import { persistAtom } from 'src/state/persist/localStorage'
66
import { isDefaultValue } from 'src/state/utils/isDefaultValue'
7-
import { areDatasetsEqual } from 'src/types'
87

98
export interface Datasets {
109
datasets: Dataset[]
@@ -29,11 +28,11 @@ export const datasetCurrentAtom = selector<Dataset | undefined>({
2928
get({ get }) {
3029
return get(datasetCurrentStorageAtom)
3130
},
32-
set({ get, set, reset }, dataset: Dataset | undefined | DefaultValue) {
31+
set({ set, reset }, dataset: Dataset | undefined | DefaultValue) {
3332
if (isDefaultValue(dataset) || isNil(dataset)) {
3433
reset(autodetectResultsAtom)
3534
reset(datasetCurrentStorageAtom)
36-
} else if (!areDatasetsEqual(get(datasetCurrentStorageAtom), dataset)) {
35+
} else {
3736
set(datasetCurrentStorageAtom, dataset)
3837
}
3938
},

0 commit comments

Comments
 (0)