File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
WooCommerce/Classes/ViewRelated/Orders Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,18 @@ final class SummaryTableViewCell: UITableViewCell {
5151
5252 /// Displays the specified OrderStatus, and applies the right Label Style
5353 ///
54- func display( orderStatus: OrderStatus ) {
55- paymentStatusLabel. text = orderStatus. name
56- paymentStatusLabel. applyStyle ( for: orderStatus. status)
54+ func display( viewModel: OrderDetailsViewModel ) {
55+ if let orderStatus = viewModel. orderStatus {
56+ paymentStatusLabel. applyStyle ( for: orderStatus. status)
57+ paymentStatusLabel. text = orderStatus. name
58+ } else {
59+ // There are unsupported extensions with even more statuses available.
60+ // So let's use the order.statusKey to display those as slugs.
61+ let statusKey = viewModel. order. statusKey
62+ let statusEnum = OrderStatusEnum ( rawValue: statusKey)
63+ paymentStatusLabel. applyStyle ( for: statusEnum)
64+ paymentStatusLabel. text = viewModel. order. statusKey
65+ }
5766 }
5867
5968
Original file line number Diff line number Diff line change @@ -601,9 +601,7 @@ private extension OrderDetailsViewController {
601601 self ? . displayOrderStatusList ( )
602602 }
603603
604- if let orderStatus = viewModel. orderStatus {
605- cell. display ( orderStatus: orderStatus)
606- }
604+ cell. display ( viewModel: viewModel)
607605 }
608606}
609607
You can’t perform that action at this time.
0 commit comments