Skip to content

Commit

Permalink
Rename PackageSelectionState property
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomazFB committed Dec 12, 2024
1 parent 680eb03 commit 2d25059
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class WooShippingLabelCreationViewModel @Inject constructor(
private val selectedRatesSortOrder = MutableStateFlow(ShippingSortOption.FASTEST)
private val refreshShippingRates = MutableSharedFlow<Unit>()

private val selectedPackage = MutableStateFlow<PackageSelectionState>(NotSelected)
private val packageSelection = MutableStateFlow<PackageSelectionState>(NotSelected)

@OptIn(ExperimentalCoroutinesApi::class)
private val shippingRates =
combine(
selectedPackage,
packageSelection,
selectedRatesSortOrder,
refreshShippingRates.onStart { emit(Unit) }
) { selectedPackage, sortOrder, _ ->
Expand Down Expand Up @@ -93,7 +93,7 @@ class WooShippingLabelCreationViewModel @Inject constructor(
flowOf(orderDetailRepository.getOrderById(navArgs.orderId)),
observeOriginAddresses(),
shippingRates,
selectedPackage
packageSelection
) { storeOptions, order, originAddresses, shippingRates, packageSelection ->
val selectedOriginAddress = getSelectedOriginAddress(originAddresses)
if (order == null || selectedOriginAddress == null) {
Expand Down Expand Up @@ -195,7 +195,7 @@ class WooShippingLabelCreationViewModel @Inject constructor(
}

fun onPackageSelected(packageData: PackageData) {
selectedPackage.update { content ->
packageSelection.update { content ->
when (content) {
is NotSelected -> PackageSelectionState.Data(
selectedPackage = packageData,
Expand Down

0 comments on commit 2d25059

Please sign in to comment.