Skip to content

Commit 321b2f3

Browse files
committed
feat: reset password field when moving to confirm password
1 parent 9bbc901 commit 321b2f3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/src/main/java/com/yogeshpaliyal/keypass/ui/auth/AuthScreen.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ fun AuthScreen(state: AuthState) {
4343
dispatchAction(NavigationAction(AuthState.CreatePassword, true))
4444
}
4545

46+
// Reset password field when navigating to ConfirmPassword state
47+
LaunchedEffect(state) {
48+
if (state is AuthState.ConfirmPassword) {
49+
password.value = ""
50+
passwordVisible.value = false
51+
passwordError.value = null
52+
}
53+
}
54+
4655
LaunchedEffect(key1 = userSettings.keyPassPassword) {
4756
val mPassword = userSettings.keyPassPassword
4857
if (mPassword == null) {
@@ -103,4 +112,4 @@ fun AuthScreen(state: AuthState) {
103112
dispatchAction(it)
104113
}
105114
}
106-
}
115+
}

0 commit comments

Comments
 (0)