chore: update filter hub while searching

This commit is contained in:
Faisal Amir 2025-08-25 16:51:30 +07:00
parent e73a710c06
commit e376314315

View File

@ -394,13 +394,13 @@ function Hub() {
) )
} }
}, [ }, [
localDownloadingModels,
downloadProcesses, downloadProcesses,
llamaProvider?.models, llamaProvider?.models,
isRecommendedModel, isRecommendedModel,
downloadButtonRef,
localDownloadingModels,
addLocalDownloadingModel,
t, t,
addLocalDownloadingModel,
huggingfaceToken,
handleUseModel, handleUseModel,
]) ])
@ -477,9 +477,9 @@ function Hub() {
const isLastStep = currentStepIndex === steps.length - 1 const isLastStep = currentStepIndex === steps.length - 1
const renderFilter = () => { const renderFilter = () => {
if (searchValue.length === 0) return (
return ( <>
<> {searchValue.length === 0 && (
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger> <DropdownMenuTrigger>
<span className="flex cursor-pointer items-center gap-1 px-2 py-1 rounded-sm bg-main-view-fg/15 text-sm outline-none text-main-view-fg font-medium"> <span className="flex cursor-pointer items-center gap-1 px-2 py-1 rounded-sm bg-main-view-fg/15 text-sm outline-none text-main-view-fg font-medium">
@ -504,17 +504,18 @@ function Hub() {
))} ))}
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
<div className="flex items-center gap-2"> )}
<Switch <div className="flex items-center gap-2">
checked={showOnlyDownloaded} <Switch
onCheckedChange={setShowOnlyDownloaded} checked={showOnlyDownloaded}
/> onCheckedChange={setShowOnlyDownloaded}
<span className="text-xs text-main-view-fg/70 font-medium whitespace-nowrap"> />
{t('hub:downloaded')} <span className="text-xs text-main-view-fg/70 font-medium whitespace-nowrap">
</span> {t('hub:downloaded')}
</div> </span>
</> </div>
) </>
)
} }
return ( return (