Просмотр исходного кода

Merge pull request #1332 from aheizi/fix_switch_mode

fix: switch mode state
Matt Rubens 10 месяцев назад
Родитель
Сommit
9faed0e0dc
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      webview-ui/src/components/chat/ChatView.tsx

+ 5 - 0
webview-ui/src/components/chat/ChatView.tsx

@@ -973,7 +973,12 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
 		const allModes = getAllModes(customModes)
 		const currentModeIndex = allModes.findIndex((m) => m.slug === mode)
 		const nextModeIndex = (currentModeIndex + 1) % allModes.length
+		// Update local state and notify extension to sync mode change
 		setMode(allModes[nextModeIndex].slug)
+		vscode.postMessage({
+			type: "mode",
+			text: allModes[nextModeIndex].slug,
+		})
 	}, [mode, setMode, customModes])
 
 	// Add keyboard event handler