Skip to content

Commit

Permalink
fixed issue when leaving playground after adding new variant
Browse files Browse the repository at this point in the history
  • Loading branch information
bekossy committed Apr 29, 2024
1 parent dd4e8fc commit 03ee378
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions agenta-web/src/components/Playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const Playground: React.FC = () => {
)
setVariants((prevState: any) => [...prevState, newVariant])
setActiveKey(updateNewVariantName)
setUnsavedVariants((prev) => ({...prev, [newVariant.variantName!]: false}))
} catch (error) {
message.error("Failed to add new variant. Please try again later.")
console.error("Error adding new variant:", error)
Expand Down
4 changes: 0 additions & 4 deletions agenta-web/src/components/Playground/Views/ParametersView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ const ParametersView: React.FC<Props> = ({
const [revisionNum, setRevisionNum] = useQueryParam("revision")
const [promptRevisions, setPromptRevisions] = useState<IPromptRevisions[]>([])

useEffect(() => {
onStateChange(variant.persistent === false)
}, [])

const onChange = (param: Parameter, newValue: number | string) => {
handleParamChange(param.name, newValue)
}
Expand Down

0 comments on commit 03ee378

Please sign in to comment.