mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fix settings done button with unsaved changes
This commit is contained in:
parent
5a2f2eadc6
commit
7d58fe76bb
1 changed files with 8 additions and 11 deletions
|
|
@ -28,16 +28,13 @@ const App = () => {
|
|||
const [tab, setTab] = useState<Tab>("chat")
|
||||
const settingsRef = useRef<SettingsViewRef>(null)
|
||||
|
||||
const switchTab = useCallback(
|
||||
(newTab: Tab) => {
|
||||
if (tab === "settings" && settingsRef.current?.checkUnsaveChanges) {
|
||||
settingsRef.current.checkUnsaveChanges(() => setTab(newTab))
|
||||
} else {
|
||||
setTab(newTab)
|
||||
}
|
||||
},
|
||||
[tab],
|
||||
)
|
||||
const switchTab = useCallback((newTab: Tab) => {
|
||||
if (settingsRef.current?.checkUnsaveChanges) {
|
||||
settingsRef.current.checkUnsaveChanges(() => setTab(newTab))
|
||||
} else {
|
||||
setTab(newTab)
|
||||
}
|
||||
}, [])
|
||||
|
||||
const onMessage = useCallback(
|
||||
(e: MessageEvent) => {
|
||||
|
|
@ -73,7 +70,7 @@ const App = () => {
|
|||
<WelcomeView />
|
||||
) : (
|
||||
<>
|
||||
{tab === "settings" && <SettingsView ref={settingsRef} onDone={() => switchTab("chat")} />}
|
||||
{tab === "settings" && <SettingsView ref={settingsRef} onDone={() => setTab("chat")} />}
|
||||
{tab === "history" && <HistoryView onDone={() => switchTab("chat")} />}
|
||||
{tab === "mcp" && <McpView onDone={() => switchTab("chat")} />}
|
||||
{tab === "prompts" && <PromptsView onDone={() => switchTab("chat")} />}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue