Use if instead of non-exhaustive when clause

Kotlin 1.7.0 requires when statements on enums to be exhaustive.
Switch from a when with a single clause to an if statement.

Bug: 216136346
Test: m CredentialManager
Change-Id: Ief5a38ba1af05f6cd882a1e035538a44ff2753d3
This commit is contained in:
Colin Cross
2022-10-04 21:26:33 -07:00
parent 21628242ff
commit 7080083f04
2 changed files with 4 additions and 8 deletions

View File

@@ -79,10 +79,8 @@ fun CreatePasskeyScreen(
sheetShape = Shapes.medium,
) {}
LaunchedEffect(state.currentValue) {
when (state.currentValue) {
ModalBottomSheetValue.Hidden -> {
cancelActivity()
}
if (state.currentValue == ModalBottomSheetValue.Hidden) {
cancelActivity()
}
}
}

View File

@@ -64,10 +64,8 @@ fun GetCredentialScreen(
sheetShape = Shapes.medium,
) {}
LaunchedEffect(state.currentValue) {
when (state.currentValue) {
ModalBottomSheetValue.Hidden -> {
cancelActivity()
}
if (state.currentValue == ModalBottomSheetValue.Hidden) {
cancelActivity()
}
}
}