Skip to content

Commit

Permalink
Merge pull request #1343 from nextstrain/fix/web-prevent-autosuggest-…
Browse files Browse the repository at this point in the history
…dual-run
  • Loading branch information
ivan-aksamentov authored Dec 15, 2023
2 parents bbe85ec + 37e1930 commit 4fd03ba
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Col, Row } from 'reactstrap'
import { useRecoilState, useRecoilValue } from 'recoil'
import styled from 'styled-components'
import { SuggestionAlertMainPage } from 'src/components/Main/SuggestionAlertMainPage'
import { AutodetectRunState, autodetectRunStateAtom } from 'src/state/autodetect.state'
import { datasetCurrentAtom } from 'src/state/dataset.state'
import { hasRequiredInputsAtom } from 'src/state/inputs.state'
import { shouldSuggestDatasetsOnDatasetPageAtom } from 'src/state/settings.state'
Expand Down Expand Up @@ -71,16 +72,17 @@ export function Landing() {
const runAutodetect = useRunSeqAutodetect()
const hasRequiredInputs = useRecoilValue(hasRequiredInputsAtom)
const shouldSuggestDatasets = useRecoilValue(shouldSuggestDatasetsOnDatasetPageAtom)
const autodetectRunState = useRecoilValue(autodetectRunStateAtom)

const toDatasetSelection = useCallback(() => {
// eslint-disable-next-line no-void
void push('/dataset').then(() => {
if (shouldSuggestDatasets && hasRequiredInputs) {
if (shouldSuggestDatasets && hasRequiredInputs && autodetectRunState !== AutodetectRunState.Started) {
runAutodetect()
}
return undefined
})
}, [hasRequiredInputs, push, runAutodetect, shouldSuggestDatasets])
}, [autodetectRunState, hasRequiredInputs, push, runAutodetect, shouldSuggestDatasets])

return (
<ContainerFixed>
Expand Down

1 comment on commit 4fd03ba

@vercel
Copy link

@vercel vercel bot commented on 4fd03ba Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextclade – ./

nextclade-nextstrain.vercel.app
nextclade.vercel.app
nextclade-git-master-nextstrain.vercel.app

Please sign in to comment.