Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.hedvig.android.feature.chip.id.ui.selectinsurance.SelectInsuranceForC
import com.hedvig.android.navigation.compose.navDeepLinks
import com.hedvig.android.navigation.compose.navdestination
import com.hedvig.android.navigation.compose.navgraph
import com.hedvig.android.navigation.compose.typed.getRouteFromBackStack
import com.hedvig.android.navigation.compose.typed.getRouteFromBackStackOrNull
import com.hedvig.android.navigation.compose.typedPopUpTo
import com.hedvig.android.navigation.core.HedvigDeepLinkContainer
import org.koin.compose.viewmodel.koinViewModel
Expand Down Expand Up @@ -49,8 +49,8 @@ fun NavGraphBuilder.chipIdGraph(
) {
navdestination<ChipIdDestination.SelectInsuranceForChipId> { backStackEntry ->
val chipIdGraphDestination = navController
.getRouteFromBackStack<ChipIdGraphDestination>(backStackEntry)
val preselectedContractId = chipIdGraphDestination.contractId
.getRouteFromBackStackOrNull<ChipIdGraphDestination>(backStackEntry)
val preselectedContractId = chipIdGraphDestination?.contractId

val viewModel: SelectInsuranceForChipIdViewModel = koinViewModel {
parametersOf(preselectedContractId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.hedvig.android.navigation.compose.navDeepLinks
import com.hedvig.android.navigation.compose.navdestination
import com.hedvig.android.navigation.compose.navgraph
import com.hedvig.android.navigation.compose.typed.getRouteFromBackStack
import com.hedvig.android.navigation.compose.typed.getRouteFromBackStackOrNull
import com.hedvig.android.navigation.compose.typedPopUpTo
import com.hedvig.android.navigation.core.HedvigDeepLinkContainer
import org.koin.compose.viewmodel.koinViewModel
Expand Down Expand Up @@ -89,9 +90,9 @@ fun NavGraphBuilder.terminateInsuranceGraph(
) {
navdestination<TerminateInsuranceDestination.StartStep> { backStackEntry ->
val terminateInsuranceGraphDestination = navController
.getRouteFromBackStack<TerminateInsuranceGraphDestination>(backStackEntry)
.getRouteFromBackStackOrNull<TerminateInsuranceGraphDestination>(backStackEntry)
val viewModel: ChooseInsuranceToTerminateViewModel = koinViewModel {
parametersOf(terminateInsuranceGraphDestination.insuranceId)
parametersOf(terminateInsuranceGraphDestination?.insuranceId)
}
ChooseInsuranceToTerminateDestination(
viewModel = viewModel,
Expand Down
Loading