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
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
21.2
-----

- [*] Fixed a crash that occurred when tapping on the customer shipping address in the order details screen [https://github.com/woocommerce/woocommerce-android/pull/12920]

21.1
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,7 @@ class OrderDetailCustomerInfoView @JvmOverloads constructor(
)

binding.customerInfoCustomerNoteSection.setOnClickListener {
val action =
OrderDetailFragmentDirections.actionOrderDetailFragmentToEditCustomerOrderNoteFragment(
order.id
)
findNavController().navigateSafely(action)
navigateToCustomerNote(order)
}
}
}
Expand Down Expand Up @@ -290,13 +286,26 @@ class OrderDetailCustomerInfoView @JvmOverloads constructor(
}
}

private fun navigateToCustomerNote(order: Order) {
if (!isAttachedToWindow) return

val action = OrderDetailFragmentDirections.actionOrderDetailFragmentToEditCustomerOrderNoteFragment(
order.id
)
findNavController().navigateSafely(action)
}

private fun navigateToShippingAddressEditingView(address: Address) {
if (!isAttachedToWindow) return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple and elegant solution. Great work!


OrderDetailFragmentDirections
.actionOrderDetailFragmentToShippingAddressEditingFragment(storedAddress = address)
.let { findNavController().navigateSafely(it) }
}

private fun navigateToBillingAddressEditingView(address: Address) {
if (!isAttachedToWindow) return

OrderDetailFragmentDirections
.actionOrderDetailFragmentToBillingAddressEditingFragment(storedAddress = address)
.let { findNavController().navigateSafely(it) }
Expand Down
Loading