File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/main/kotlin/ee/carlrobert/codegpt/settings/service/custom Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,19 @@ class CustomServiceSettings :
14
14
SimplePersistentStateComponent <CustomServiceState >(CustomServiceState ()) {
15
15
16
16
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
20
20
template = state.template
21
21
chatCompletionSettings.url = state.url
22
22
chatCompletionSettings.body = state.body
23
23
chatCompletionSettings.headers = state.headers
24
24
url = null
25
25
body = mutableMapOf ()
26
26
headers = mutableMapOf ()
27
- }
27
+ })
28
+ } else {
29
+ super .loadState(state)
28
30
}
29
31
}
30
32
}
You can’t perform that action at this time.
0 commit comments