Skip to content

Commit 8917589

Browse files
PR feedback - don't relax type checks
1 parent 783138c commit 8917589

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
779779
const existingPrompts = getGlobalState("customModePrompts") ?? {}
780780
const updatedPrompts = { ...existingPrompts, [message.promptMode]: message.customPrompt }
781781
await updateGlobalState("customModePrompts", updatedPrompts)
782-
const currentState = await provider.getState()
782+
const currentState = await provider.getStateToPostToWebview()
783783
const stateWithPrompts = { ...currentState, customModePrompts: updatedPrompts }
784784
provider.postMessageToWebview({ type: "state", state: stateWithPrompts })
785785
}

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface ExtensionMessage {
7878
| "promptsButtonClicked"
7979
| "didBecomeVisible"
8080
invoke?: "newChat" | "sendMessage" | "primaryButtonClick" | "secondaryButtonClick" | "setChatBoxMessage"
81-
state?: Partial<ExtensionState>
81+
state?: ExtensionState
8282
images?: string[]
8383
ollamaModels?: string[]
8484
lmStudioModels?: string[]

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export interface ExtensionStateContextType extends ExtensionState {
8888

8989
export const ExtensionStateContext = createContext<ExtensionStateContextType | undefined>(undefined)
9090

91-
export const mergeExtensionState = (prevState: ExtensionState, newState: Partial<ExtensionState>) => {
91+
export const mergeExtensionState = (prevState: ExtensionState, newState: ExtensionState) => {
9292
const {
9393
customModePrompts: prevCustomModePrompts,
9494
customSupportPrompts: prevCustomSupportPrompts,

0 commit comments

Comments
 (0)