Skip to content

Commit d327c21

Browse files
authored
Merge pull request #1090 from RooVetGit/fix_settings_done_button_with_unsaved_changes
Fix settings done button with unsaved changes
2 parents 7171a0e + e69f27d commit d327c21

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changeset/twenty-rice-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Fix settings done button with unsaved changes

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
173173
text: currentApiConfigName,
174174
apiConfiguration,
175175
})
176-
// onDone()
177176
setChangeDetected(false)
178177
}
179178
}
@@ -217,7 +216,11 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
217216

218217
const onConfirmDialogResult = useCallback((confirm: boolean) => {
219218
if (confirm) {
220-
confirmDialogHandler.current?.()
219+
setChangeDetected(false)
220+
// Wait for the change detection to be updated
221+
setTimeout(() => {
222+
confirmDialogHandler.current?.()
223+
}, 100)
221224
}
222225
}, [])
223226

0 commit comments

Comments
 (0)