Skip to content

Commit

Permalink
fix(web): prevent infinite loading when using dataset-url param
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov committed Dec 12, 2023
1 parent d43b9b3 commit 659fd9a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages_rs/nextclade-web/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,15 @@ export function RecoilStateInitializer() {
set(localeAtom, locale.key)
})
.then(async () => {
const datasetInfo = await fetchSingleDataset(urlQuery)
const datasetServerUrl = await getDatasetServerUrl(urlQuery)
set(datasetServerUrlAtom, datasetServerUrl)
const { datasets, currentDataset, minimizerIndexVersion } = await initializeDatasets(datasetServerUrl, urlQuery)

const datasetInfo = await fetchSingleDataset(urlQuery)
if (!isNil(datasetInfo)) {
const { datasets, currentDataset } = datasetInfo
return { datasets, currentDataset, minimizerIndexVersion: undefined }
}

const datasetServerUrl = await getDatasetServerUrl(urlQuery)
set(datasetServerUrlAtom, datasetServerUrl)

const { datasets, currentDataset, minimizerIndexVersion } = await initializeDatasets(datasetServerUrl, urlQuery)
return { datasets, currentDataset, minimizerIndexVersion }
})
.catch((error) => {
Expand Down

0 comments on commit 659fd9a

Please sign in to comment.