Skip to content

Commit 8c9d485

Browse files
committed
Rename selectableItems to shipmentsUIMap in WooShippingSplitShipmentViewModel
1 parent 9e3a59a commit 8c9d485

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/split/WooShippingSplitShipmentViewModel.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class WooShippingSplitShipmentViewModel @Inject constructor(
3131
private val storeOptions = navArgs.shipmentArgs.storeOptions
3232

3333
private val currentShipments = MutableStateFlow(navArgs.shipmentArgs.shipments)
34-
val selectableItems: MutableStateFlow<Map<Int, SelectableShippableItemsUI>?> = MutableStateFlow(null)
34+
private val shipmentsUIMap: MutableStateFlow<Map<Int, SelectableShippableItemsUI>?> = MutableStateFlow(null)
3535

3636
private val shipmentSelected = MutableStateFlow(navArgs.shipmentArgs.shipments.keys.first())
3737
private val removeShipmentSheet: MutableStateFlow<RemoveShipmentSheet?> = MutableStateFlow(null)
@@ -44,7 +44,7 @@ class WooShippingSplitShipmentViewModel @Inject constructor(
4444
}
4545
launch {
4646
currentShipments.collectLatest { shipments ->
47-
selectableItems.value = shipments.mapValues {
47+
shipmentsUIMap.value = shipments.mapValues {
4848
it.value.toSelectableUIModel(
4949
currencyFormatter = currencyFormatter,
5050
dimensionUnit = storeOptions.dimensionUnit,
@@ -57,7 +57,7 @@ class WooShippingSplitShipmentViewModel @Inject constructor(
5757

5858
val viewState = combine(
5959
shipmentSelected,
60-
selectableItems.filterNotNull(),
60+
shipmentsUIMap.filterNotNull(),
6161
removeShipmentSheet,
6262
splitMessage
6363
) { shipmentSelected, selectableItems, sheet, message ->
@@ -109,7 +109,7 @@ class WooShippingSplitShipmentViewModel @Inject constructor(
109109
shippableItemIndex: Int,
110110
selectedIndexes: Set<Int>? = null
111111
) {
112-
val shipmentsMap = selectableItems.value?.toMutableMap() ?: return
112+
val shipmentsMap = shipmentsUIMap.value?.toMutableMap() ?: return
113113
val items = shipmentsMap.getValue(shipmentKey)
114114
val item = items.shippableItems[shippableItemIndex]
115115
val updatedItem = when (item) {
@@ -129,7 +129,7 @@ class WooShippingSplitShipmentViewModel @Inject constructor(
129129
val updatedList = items.shippableItems.toMutableList()
130130
updatedList[shippableItemIndex] = updatedItem
131131
shipmentsMap[shipmentKey] = items.copy(shippableItems = updatedList)
132-
selectableItems.value = shipmentsMap
132+
shipmentsUIMap.value = shipmentsMap
133133
}
134134

135135
fun onUpdateShipment(splitMovement: SplitMovement) {

0 commit comments

Comments
 (0)