fix: ensure dialog title is set correctly in KeyboardInteractiveDialog

This commit is contained in:
hstyi
2025-11-28 16:30:48 +08:00
committed by hstyi
parent 5b165ed587
commit 626b344088
2 changed files with 4 additions and 1 deletions

View File

@@ -27,12 +27,14 @@ class KeyboardInteractiveDialog(
isModal = true isModal = true
isResizable = true isResizable = true
controlsVisible = false controlsVisible = false
title = I18n.getString("termora.new-host.title")
init() init()
pack() pack()
size = Dimension(max(300, size.width), size.height) size = Dimension(max(300, size.width), size.height)
// fix https://github.com/TermoraDev/termora/issues/1311
pack()
setLocationRelativeTo(null) setLocationRelativeTo(null)
} }

View File

@@ -30,6 +30,7 @@ class TerminalUserInteraction(
) )
dialog.setLocationRelativeTo(owner) dialog.setLocationRelativeTo(owner)
dialog.title = instruction ?: name ?: "OTP" dialog.title = instruction ?: name ?: "OTP"
dialog.title = StringUtils.defaultIfBlank(dialog.title, "OTP")
passwords[i] = dialog.getText() passwords[i] = dialog.getText()
if (passwords[i].isBlank()) { if (passwords[i].isBlank()) {
break break