Skip to content

Commit 93dbc2a

Browse files
committed
fix: reset error field when switching back and forth in the wizard
1 parent 2bbabc2 commit 93dbc2a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/main/kotlin/com/coder/toolbox/views/ConnectStep.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class ConnectStep(
4343
override val nextButtonTitle: LocalizableString? = null
4444

4545
override fun onVisible() {
46+
errorField.textState.update {
47+
context.i18n.pnotr("")
48+
}
49+
4650
val url = context.deploymentUrl?.first?.toURL()
4751
statusField.textState.update { context.i18n.pnotr("Connecting to ${url?.host}...") }
4852
connect()

src/main/kotlin/com/coder/toolbox/views/SignInStep.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class SignInStep(private val context: CoderToolboxContext) : WizardStep {
3030
override val nextButtonTitle: LocalizableString? = context.i18n.ptrl("Sign In")
3131

3232
override fun onVisible() {
33+
errorField.textState.update {
34+
context.i18n.pnotr("")
35+
}
3336
urlField.textState.update {
3437
context.deploymentUrl?.first ?: ""
3538
}

src/main/kotlin/com/coder/toolbox/views/TokenStep.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class TokenStep(private val context: CoderToolboxContext) : WizardStep {
3535
override val nextButtonTitle: LocalizableString? = context.i18n.ptrl("Connect")
3636

3737
override fun onVisible() {
38+
errorField.textState.update {
39+
context.i18n.pnotr("")
40+
}
3841
tokenField.textState.update {
3942
context.getToken(context.deploymentUrl?.first)?.first ?: ""
4043
}

0 commit comments

Comments
 (0)