Skip to content

Commit 2c6bf00

Browse files
committed
fix(clients): input is not validated when card is changed
1 parent 508211e commit 2c6bf00

File tree

1 file changed

+6
-6
lines changed
  • src/main/kotlin/com/github/blarc/ai/commits/intellij/plugin/settings/clients

1 file changed

+6
-6
lines changed

src/main/kotlin/com/github/blarc/ai/commits/intellij/plugin/settings/clients/LLMClientTable.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ class LLMClientTable {
156156
}
157157
}
158158

159-
// Register validators of the currently active cards
160-
val dialogPanel = cardLayout.findComponentById(llmClient.getClientName()) as DialogPanel
161-
dialogPanel.registerValidators(myDisposable) {
162-
isOKActionEnabled = ContainerUtil.and(it.values) { info: ValidationInfo -> info.okEnabled }
163-
}
164-
165159
val cardsList = JBList(llmClientConfigurations).apply {
166160
val descriptor = object : ListItemDescriptorAdapter<LLMClientConfiguration>() {
167161
override fun getTextFor(value: LLMClientConfiguration) = value.getClientName()
@@ -175,6 +169,12 @@ class LLMClientTable {
175169
addListSelectionListener {
176170
llmClient = selectedValue
177171
cardLayout.show(cardPanel, llmClient.getClientName())
172+
173+
// Register validators of the currently active cards
174+
val dialogPanel = cardLayout.findComponentById(llmClient.getClientName()) as DialogPanel
175+
dialogPanel.registerValidators(myDisposable) {
176+
isOKActionEnabled = ContainerUtil.and(it.values) { info: ValidationInfo -> info.okEnabled }
177+
}
178178
}
179179
setSelectedValue(llmClient, true)
180180
}

0 commit comments

Comments
 (0)