fix: glitch download from onboarding (#5269)
This commit is contained in:
parent
1e17cc6ec7
commit
b5bdf3cfd2
@ -78,6 +78,7 @@ function Hub() {
|
|||||||
null
|
null
|
||||||
)
|
)
|
||||||
const downloadButtonRef = useRef<HTMLButtonElement>(null)
|
const downloadButtonRef = useRef<HTMLButtonElement>(null)
|
||||||
|
const hasTriggeredDownload = useRef(false)
|
||||||
|
|
||||||
const { getProviderByName } = useModelProvider()
|
const { getProviderByName } = useModelProvider()
|
||||||
const llamaProvider = getProviderByName('llama.cpp')
|
const llamaProvider = getProviderByName('llama.cpp')
|
||||||
@ -285,12 +286,18 @@ function Hub() {
|
|||||||
const handleJoyrideCallback = (data: CallBackProps) => {
|
const handleJoyrideCallback = (data: CallBackProps) => {
|
||||||
const { status, index } = data
|
const { status, index } = data
|
||||||
|
|
||||||
if (status === STATUS.FINISHED && !isDownloading && isLastStep) {
|
if (
|
||||||
|
status === STATUS.FINISHED &&
|
||||||
|
!isDownloading &&
|
||||||
|
isLastStep &&
|
||||||
|
!hasTriggeredDownload.current
|
||||||
|
) {
|
||||||
const recommendedModel = filteredModels.find((model) =>
|
const recommendedModel = filteredModels.find((model) =>
|
||||||
isRecommendedModel(model.metadata?.id)
|
isRecommendedModel(model.metadata?.id)
|
||||||
)
|
)
|
||||||
if (recommendedModel && recommendedModel.models[0]?.id) {
|
if (recommendedModel && recommendedModel.models[0]?.id) {
|
||||||
if (downloadButtonRef.current) {
|
if (downloadButtonRef.current) {
|
||||||
|
hasTriggeredDownload.current = true
|
||||||
downloadButtonRef.current.click()
|
downloadButtonRef.current.click()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user