Skip to content

Commit

Permalink
Make serverToRecentModel map static
Browse files Browse the repository at this point in the history
  • Loading branch information
mkondratek committed Nov 28, 2024
1 parent 61fadbf commit 33a9987
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/kotlin/com/sourcegraph/cody/chat/ui/LlmDropdown.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class LlmDropdown(
private val fixedModel: String? = null
) : ComboBox<ModelAvailabilityStatus>(MutableCollectionComboBoxModel()) {

private val serverToRecentModel = HashMap<SourcegraphServerPath, Model>()

init {
renderer = LlmComboBoxRenderer(this)
isVisible = false
Expand Down Expand Up @@ -77,7 +75,7 @@ class LlmDropdown(
availableModels.find { it.model.id == fixedModel || it.model.id == defaultLlm?.id }
?: models.firstOrNull()

isEnabled = fixedModel != null
isEnabled = fixedModel == null
isVisible = selectedItem != null
setMaximumRowCount(15)

Expand All @@ -104,4 +102,8 @@ class LlmDropdown(
onSetSelectedItem(modelProvider.model)
}
}

companion object {
private val serverToRecentModel = HashMap<SourcegraphServerPath, Model>()
}
}

0 comments on commit 33a9987

Please sign in to comment.