fix: should disable start model button when there is a model is loading (#4713)

This commit is contained in:
Louis 2025-02-21 01:05:17 +07:00 committed by GitHub
parent a47942d7df
commit c5a5e55afe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,9 +135,11 @@ const MyModelList = ({ model }: Props) => {
<div <div
className={twMerge( className={twMerge(
'flex items-center space-x-2 px-4 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]', 'flex items-center space-x-2 px-4 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]',
serverEnabled && 'cursor-not-allowed opacity-40' (serverEnabled || stateModel.loading) &&
'cursor-not-allowed opacity-40'
)} )}
onClick={() => { onClick={() => {
if (serverEnabled || stateModel.loading) return
onModelActionClick(model.id) onModelActionClick(model.id)
setMore(false) setMore(false)
}} }}
@ -159,7 +161,7 @@ const MyModelList = ({ model }: Props) => {
</span> </span>
</div> </div>
} }
disabled={!serverEnabled} disabled={!serverEnabled || stateModel.loading}
content={ content={
<span> <span>
{activeModel && activeModel.id === model.id {activeModel && activeModel.id === model.id