Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7080083f authored by Colin Cross's avatar Colin Cross
Browse files

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
parent 21628242
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -79,13 +79,11 @@ fun CreatePasskeyScreen(
    sheetShape = Shapes.medium,
  ) {}
  LaunchedEffect(state.currentValue) {
    when (state.currentValue) {
      ModalBottomSheetValue.Hidden -> {
    if (state.currentValue == ModalBottomSheetValue.Hidden) {
      cancelActivity()
    }
  }
}
}

@Composable
fun ConfirmationCard(
+2 −4
Original line number Diff line number Diff line
@@ -64,13 +64,11 @@ fun GetCredentialScreen(
    sheetShape = Shapes.medium,
  ) {}
  LaunchedEffect(state.currentValue) {
    when (state.currentValue) {
      ModalBottomSheetValue.Hidden -> {
    if (state.currentValue == ModalBottomSheetValue.Hidden) {
      cancelActivity()
    }
  }
}
}

@ExperimentalMaterialApi
@Composable