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

Merge pull request #1090 from RooVetGit/fix_settings_done_button_with_unsaved_changes

Fix settings done button with unsaved changes
Matt Rubens 10 месяцев назад
Родитель
Сommit
d327c21828
2 измененных файлов с 10 добавлено и 2 удалено
  1. 5 0
      .changeset/twenty-rice-own.md
  2. 5 2
      webview-ui/src/components/settings/SettingsView.tsx

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