conditional copy button save, if have engine params changes value button should be save & reload
This commit is contained in:
parent
bf9cd4443c
commit
0f333c35f5
@ -187,6 +187,10 @@ const Sidebar: React.FC = () => {
|
||||
return changedFieldValues
|
||||
}
|
||||
|
||||
const isEngineParamsChanges = componentDataEngineSetting.some((x) =>
|
||||
Object.keys(form.formState.dirtyFields).includes(x.name)
|
||||
)
|
||||
|
||||
const onSubmit = async (values: any) => {
|
||||
if (!threadId) return
|
||||
if (!activeThread) return
|
||||
@ -401,7 +405,7 @@ const Sidebar: React.FC = () => {
|
||||
<Tooltip open={currentPrompt.length !== 0}>
|
||||
<TooltipTrigger asChild>
|
||||
<Button type="submit" block>
|
||||
Save
|
||||
{isEngineParamsChanges ? 'Save & Reload' : 'Save'}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipPortal>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user