fix: fall back to "Select *" text if nothing is selected

This commit is contained in:
Johannes Frohnmeyer 2024-05-17 09:02:57 +02:00
parent 5671847bf7
commit d3ccb51df4
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class SDContestSelectionComboBoxAction : ComboBoxAction(), DumbAware {
override fun update(e: AnActionEvent) {
e.presentation.isEnabledAndVisible = SDom.loggedIn
SDom.currentContest?.let { e.presentation.setText(it.name, false) }
e.presentation.setText(SDom.currentContest?.name ?: "Select Contest", false)
}
override fun createPopupActionGroup(button: JComponent, dataContext: DataContext): DefaultActionGroup {

View File

@ -20,7 +20,7 @@ class SDProblemSelectionComboBoxAction : ComboBoxAction(), DumbAware {
override fun update(e: AnActionEvent) {
e.presentation.isVisible = SDom.loggedIn
e.presentation.isEnabled = SDom.loggedIn && SDom.currentContest != null
SDom.currentProblem?.let { e.presentation.setText(it.name, false) }
e.presentation.setText(SDom.currentProblem?.name ?: "Select Problem", false)
}
override fun createPopupActionGroup(button: JComponent, dataContext: DataContext): DefaultActionGroup {