mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
refactor: use typed message interfaces instead of inline casts
Use EnhancePromptResultMessage and EnhancePromptErrorMessage types from messages.ts instead of inline type assertions.
This commit is contained in:
@@ -122,7 +122,7 @@ export const PromptInput: Component = () => {
|
||||
}
|
||||
|
||||
if (message.type === "enhancePromptResult") {
|
||||
const result = message as { type: "enhancePromptResult"; text: string; requestId: string }
|
||||
const result = message as import("../../types/messages").EnhancePromptResultMessage
|
||||
if (result.requestId === `enhance-${enhanceCounter}`) {
|
||||
setText(result.text)
|
||||
setGhostText("")
|
||||
@@ -136,7 +136,7 @@ export const PromptInput: Component = () => {
|
||||
}
|
||||
|
||||
if (message.type === "enhancePromptError") {
|
||||
const result = message as { type: "enhancePromptError"; error: string; requestId: string }
|
||||
const result = message as import("../../types/messages").EnhancePromptErrorMessage
|
||||
if (result.requestId === `enhance-${enhanceCounter}`) {
|
||||
setEnhancing(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user