Commit edb80ec0 authored by Karlatemp's avatar Karlatemp

Fix the error that directly closing the verification code window will block the coroutine.

parent 73c700b4
......@@ -22,6 +22,7 @@ import java.awt.event.WindowAdapter
import java.awt.event.WindowEvent
import javax.swing.JFrame
import javax.swing.JTextField
import javax.swing.SwingUtilities
// 隔离类代码
internal object WindowHelperJvm {
......@@ -88,7 +89,9 @@ internal suspend fun openWindow(title: String = "", initializer: WindowInitialzi
frame.title = title
frame.isVisible = true
val result = def.await()
frame.dispose()
val result = def.await().trim()
SwingUtilities.invokeLater {
frame.dispose()
}
return result
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment