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 @@ -267,7 +267,6 @@ fun PlannerScreen(
configuration = uiState.configuration,
diveMode = uiState.diveMode,
cylinders = uiState.availableGas,
segments = uiState.segments,
unitSystem = uiState.settingsModel.unitSystem,
onDismiss = { cylinderSheet = null },
onAddCylinder = onAddCylinder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import org.neotech.app.abysner.domain.core.model.Environment
import org.neotech.app.abysner.domain.core.model.Gas
import org.neotech.app.abysner.domain.core.model.UnitSystem
import org.neotech.app.abysner.domain.core.physics.PSI_PER_BAR
import org.neotech.app.abysner.domain.diveplanning.model.DiveProfileSection
import org.neotech.app.abysner.domain.diveplanning.model.PlannedCylinderModel
import org.neotech.app.abysner.presentation.utilities.ModalTarget
import org.neotech.app.abysner.presentation.component.GasPickerComponent
Expand All @@ -73,7 +72,6 @@ internal fun CylinderPickerBottomSheetHost(
configuration: Configuration,
diveMode: DiveMode = DiveMode.OPEN_CIRCUIT,
cylinders: List<PlannedCylinderModel> = emptyList(),
segments: List<DiveProfileSection> = emptyList(),
unitSystem: UnitSystem,
onDismiss: () -> Unit,
onAddCylinder: (Cylinder) -> Unit,
Expand All @@ -87,11 +85,9 @@ internal fun CylinderPickerBottomSheetHost(
}
val lockGas = plannedCylinder?.isCcrOxygen == true

val gasesInSegments = segments.mapTo(mutableSetOf()) { it.cylinder.gas }
val showBailoutToggle = diveMode.isCcr
&& plannedCylinder != null
&& !plannedCylinder.isCcrOxygen
&& plannedCylinder.cylinder.gas in gasesInSegments
&& plannedCylinder.isCcrDiluent

CylinderPickerBottomSheet(
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
Expand Down
Loading