diff --git a/plugins/github/src/org/jetbrains/plugins/github/authentication/ui/GithubAccountCombobox.kt b/plugins/github/src/org/jetbrains/plugins/github/authentication/ui/GithubAccountCombobox.kt index 064be8eceee1..4eb82ec00ba9 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/authentication/ui/GithubAccountCombobox.kt +++ b/plugins/github/src/org/jetbrains/plugins/github/authentication/ui/GithubAccountCombobox.kt @@ -4,6 +4,7 @@ package org.jetbrains.plugins.github.authentication.ui import com.intellij.openapi.ui.ComboBox import com.intellij.ui.CollectionComboBoxModel import org.jetbrains.plugins.github.authentication.accounts.GithubAccount +import java.awt.event.ItemEvent class GithubAccountCombobox(accounts: Set, defaultAccount: GithubAccount?, @@ -17,11 +18,7 @@ class GithubAccountCombobox(accounts: Set, else { selectedIndex = 0 } - if (onChange != null) { - addItemListener { - onChange(model.selectedItem as GithubAccount) - } - } + if (onChange != null) addItemListener { if (it.stateChange == ItemEvent.SELECTED) onChange(model.selectedItem as GithubAccount) } isEnabled = accounts.size > 1 } }