mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
address comments left by @mrubens on #1090 (Fix settings done button with unsaved changes);
This commit is contained in:
parent
e69f27d319
commit
6f9ada5eb0
1 changed files with 7 additions and 4 deletions
|
|
@ -217,13 +217,16 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
|
|||
const onConfirmDialogResult = useCallback((confirm: boolean) => {
|
||||
if (confirm) {
|
||||
setChangeDetected(false)
|
||||
// Wait for the change detection to be updated
|
||||
setTimeout(() => {
|
||||
confirmDialogHandler.current?.()
|
||||
}, 100)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (!isChangeDetected && confirmDialogHandler.current) {
|
||||
confirmDialogHandler.current();
|
||||
confirmDialogHandler.current = undefined; // Clear the handler after execution
|
||||
}
|
||||
}, [isChangeDetected]);
|
||||
|
||||
const handleResetState = () => {
|
||||
vscode.postMessage({ type: "resetState" })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue