fix: disable remote model when user did not setup apiKey, and change cursor when disabled (#3415)

This commit is contained in:
Faisal Amir 2024-08-19 22:46:18 +07:00 committed by GitHub
parent c4419632d6
commit d88c096c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -580,10 +580,15 @@ const ModelDropdown = ({
className={twMerge(
'cursor-pointer px-3 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]',
!apiKey
? 'cursor-disabled text-[hsla(var(--text-tertiary))]'
? 'cursor-not-allowed text-[hsla(var(--text-tertiary))]'
: 'text-[hsla(var(--text-secondary))]'
)}
onClick={() => {
if (
!apiKey &&
!localEngines.includes(model.engine)
)
return null
onClickModelItem(model.id)
}}
>