Skip to content

Commit 2285f32

Browse files
committed
Added auto add pearai
1 parent d6141dc commit 2285f32

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
glamaDefaultModelInfo,
99
openRouterDefaultModelId,
1010
openRouterDefaultModelInfo,
11+
PEARAI_URL,
1112
} from "../../../src/shared/api"
1213
import { vscode } from "../utils/vscode"
1314
import { convertTextMateToHljs } from "../utils/textMateToHljs"
@@ -162,6 +163,15 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
162163
}))
163164
const config = newState.apiConfiguration
164165
const hasKey = checkExistKey(config)
166+
if (!hasKey) {
167+
vscode.postMessage({
168+
type: "apiConfiguration",
169+
apiConfiguration: {
170+
apiProvider: "pearai",
171+
pearaiBaseUrl: PEARAI_URL,
172+
},
173+
})
174+
}
165175
setShowWelcome(!hasKey)
166176
setDidHydrateState(true)
167177
break

0 commit comments

Comments
 (0)