mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-19 07:54:46 +00:00
fix: custom service settings sync
This commit is contained in:
parent
6e6a499105
commit
39679d9ee9
1 changed files with 6 additions and 4 deletions
|
|
@ -14,9 +14,9 @@ class CustomServiceSettings :
|
|||
SimplePersistentStateComponent<CustomServiceState>(CustomServiceState()) {
|
||||
|
||||
override fun loadState(state: CustomServiceState) {
|
||||
this.state.run {
|
||||
// Migrate old settings
|
||||
if (state.url != null || state.body.isNotEmpty() || state.headers.isNotEmpty()) {
|
||||
if (state.url != null || state.body.isNotEmpty() || state.headers.isNotEmpty()) {
|
||||
super.loadState(this.state.apply {
|
||||
// Migrate old settings
|
||||
template = state.template
|
||||
chatCompletionSettings.url = state.url
|
||||
chatCompletionSettings.body = state.body
|
||||
|
|
@ -24,7 +24,9 @@ class CustomServiceSettings :
|
|||
url = null
|
||||
body = mutableMapOf()
|
||||
headers = mutableMapOf()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
super.loadState(state)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue