Skip to content

Commit 0f9022c

Browse files
committed
Revert "fix-chat-freeze-pearaiprovider (#62)"
This reverts commit bfc299f.
1 parent f56ab9a commit 0f9022c

4 files changed

Lines changed: 7 additions & 26 deletions

File tree

src/api/providers/pearai/pearai.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
4343
throw new Error("PearAI API key not found. Please login to PearAI.")
4444
} else {
4545
vscode.commands.executeCommand("pearai.checkPearAITokens", undefined)
46-
vscode.commands.executeCommand("pearai-roo-cline.pearaiTokensValidated")
4746
}
4847
this.options = options
4948

src/extension.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,6 @@ export function activate(context: vscode.ExtensionContext) {
157157
}),
158158
)
159159

160-
context.subscriptions.push(
161-
vscode.commands.registerCommand("pearai-roo-cline.pearaiTokensValidated", async () => {
162-
const provider = await ClineProvider.getInstance()
163-
if (provider) {
164-
provider.postMessageToWebview({ type: "action", action: "pearaiTokensValidated" })
165-
}
166-
}),
167-
)
168-
169160
// context.subscriptions.push(
170161
// vscode.commands.registerCommand("roo-cline.mcpButtonClicked", () => {
171162
// sidebarProvider.postMessageToWebview({ type: "action", action: "mcpButtonClicked" })

src/shared/ExtensionMessage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export interface ExtensionMessage {
6666
| "historyButtonClicked"
6767
| "promptsButtonClicked"
6868
| "didBecomeVisible"
69-
| "pearaiTokensValidated"
7069
invoke?: "newChat" | "sendMessage" | "primaryButtonClick" | "secondaryButtonClick" | "setChatBoxMessage"
7170
state?: ExtensionState
7271
images?: string[]

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
325325
return false
326326
}, [modifiedMessages, clineAsk, enableButtons, primaryButtonText])
327327

328-
const pearAiModels = usePearAiModels(apiConfiguration)
329-
330-
const { selectedModelInfo, selectedProvider } = useMemo(() => {
331-
return normalizeApiConfiguration(apiConfiguration, pearAiModels)
332-
}, [apiConfiguration, pearAiModels])
333-
334328
const handleChatReset = useCallback(() => {
335329
// Only reset message-specific state, preserving mode.
336330
setInputValue("")
@@ -367,15 +361,10 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
367361
// There is no other case that a textfield should be enabled.
368362
}
369363
}
370-
371-
if (selectedProvider === "pearai") {
372-
return
373-
}
374-
375364
handleChatReset()
376365
}
377366
},
378-
[messages.length, clineAsk, handleChatReset, selectedProvider],
367+
[messages.length, clineAsk, handleChatReset],
379368
)
380369

381370
const handleSetChatBoxMessage = useCallback(
@@ -494,6 +483,12 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
494483
startNewTask()
495484
}, [startNewTask])
496485

486+
const pearAiModels = usePearAiModels(apiConfiguration)
487+
488+
const { selectedModelInfo } = useMemo(() => {
489+
return normalizeApiConfiguration(apiConfiguration, pearAiModels)
490+
}, [apiConfiguration, pearAiModels])
491+
497492
const selectImages = useCallback(() => {
498493
vscode.postMessage({ type: "selectImages" })
499494
}, [])
@@ -512,9 +507,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
512507
textAreaRef.current?.focus()
513508
}
514509
break
515-
case "pearaiTokensValidated":
516-
handleChatReset()
517-
break
518510
}
519511
break
520512
case "selectedImages":

0 commit comments

Comments
 (0)