Procházet zdrojové kódy

Merge pull request #1090 from RooVetGit/fix_settings_done_button_with_unsaved_changes

Fix settings done button with unsaved changes
Matt Rubens před 10 měsíci
rodič
revize
d327c21828

+ 5 - 0
.changeset/twenty-rice-own.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+Fix settings done button with unsaved changes

+ 5 - 2
webview-ui/src/components/settings/SettingsView.tsx

@@ -173,7 +173,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
 				text: currentApiConfigName,
 				apiConfiguration,
 			})
-			// onDone()
 			setChangeDetected(false)
 		}
 	}
@@ -217,7 +216,11 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
 
 	const onConfirmDialogResult = useCallback((confirm: boolean) => {
 		if (confirm) {
-			confirmDialogHandler.current?.()
+			setChangeDetected(false)
+			// Wait for the change detection to be updated
+			setTimeout(() => {
+				confirmDialogHandler.current?.()
+			}, 100)
 		}
 	}, [])