Skip to content

Commit

Permalink
improved PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Abse2001 committed Jan 4, 2025
1 parent 4604927 commit 0fec8f0
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/hooks/use-code-completion-ai-api.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import { useMemo } from "react"
import { useGlobalStore } from "./use-global-store"

export const useCodeCompletionApi = () => {
const sessionToken = useGlobalStore((state) => state.session?.token)
const codeiumApiKey = useMemo(() => {
if (import.meta.env.VITE_USE_DIRECT_AI_REQUESTS === "true") {
console.warn(
"Direct AI requests are enabled. Do not use this in production.",
)
return {
apiKey: import.meta.env.VITE_CODIUM_API_KEY,
}
return import.meta.env.VITE_USE_DIRECT_AI_REQUESTS === "true"
? {
apiKey: import.meta.env.VITE_CODIUM_API_KEY,
}
: {
apiKey: "{REPLACE_ON_SERVER}",
}
}, [])

return codeiumApiKey
Expand Down

0 comments on commit 0fec8f0

Please sign in to comment.