Skip to content

Commit

Permalink
minor fix(frontend)
Browse files Browse the repository at this point in the history
  • Loading branch information
bekossy committed Dec 17, 2024
1 parent b633450 commit ddfcd02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions agenta-web/src/components/pages/settings/Secrets/Secrets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {useEffect, useState} from "react"
const {Title, Text} = Typography

export default function Secrets() {
const {secrets, handleModifyVaultSecret, handleDeleteVaultSecret, findVaultSecret} =
useVaultSecret()
const {secrets, handleModifyVaultSecret, handleDeleteVaultSecret} = useVaultSecret()
const [llmProviderKeys, setLlmProviderKeys] = useState<LlmProvider[]>([])
const [messageAPI, contextHolder] = message.useMessage()

Expand Down Expand Up @@ -49,7 +48,7 @@ export default function Secrets() {
<Button
data-cy="openai-api-save"
type="primary"
disabled={key === findVaultSecret(title) || !key}
disabled={!key}
onClick={async () => {
await handleModifyVaultSecret({
name,
Expand Down
4 changes: 0 additions & 4 deletions agenta-web/src/hooks/useVaultSecret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,9 @@ export const useVaultSecret = () => {
}
}

const findVaultSecret = (providerName: string) =>
secrets.find((item: LlmProvider) => item.title === providerName)?.key

return {
secrets,
handleModifyVaultSecret,
handleDeleteVaultSecret,
findVaultSecret,
}
}

0 comments on commit ddfcd02

Please sign in to comment.