Skip to content

Commit 39679d9

Browse files
committed
fix: custom service settings sync
1 parent 6e6a499 commit 39679d9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/kotlin/ee/carlrobert/codegpt/settings/service/custom/CustomServiceSettings.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ class CustomServiceSettings :
1414
SimplePersistentStateComponent<CustomServiceState>(CustomServiceState()) {
1515

1616
override fun loadState(state: CustomServiceState) {
17-
this.state.run {
18-
// Migrate old settings
19-
if (state.url != null || state.body.isNotEmpty() || state.headers.isNotEmpty()) {
17+
if (state.url != null || state.body.isNotEmpty() || state.headers.isNotEmpty()) {
18+
super.loadState(this.state.apply {
19+
// Migrate old settings
2020
template = state.template
2121
chatCompletionSettings.url = state.url
2222
chatCompletionSettings.body = state.body
2323
chatCompletionSettings.headers = state.headers
2424
url = null
2525
body = mutableMapOf()
2626
headers = mutableMapOf()
27-
}
27+
})
28+
} else {
29+
super.loadState(state)
2830
}
2931
}
3032
}

0 commit comments

Comments
 (0)