File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
WooCommerce/Classes/ViewModels/Booking Details Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ private extension BookingDetailsViewModel {
168168
169169 @MainActor
170170 func updateCustomerSection( with customer: Customer ) {
171- customerContent. update ( with: customer)
171+ if let billingAddress = customer. billing {
172+ customerContent. update ( with: billingAddress)
173+ }
172174 insertCustomerSectionIfAbsent ( )
173175 }
174176
Original file line number Diff line number Diff line change @@ -9,20 +9,20 @@ extension BookingDetailsViewModel {
99 @Published var billingAddressText : String ?
1010
1111 @MainActor
12- func update( with customer : Customer ) {
12+ func update( with address : Address ) {
1313 let name = [
14- customer . firstName,
15- customer . lastName
14+ address . firstName,
15+ address . lastName
1616 ]
1717 . compactMap { $0 }
1818 . filter { !$0. isEmpty }
1919 . joined ( separator: " " )
2020
21- let billingAddress = customer . billing . flatMap ( formatAddress)
21+ let billingAddress = formatAddress ( address )
2222
2323 nameText = name
24- emailText = customer . email
25- phoneText = customer . billing ? . phone ?? " "
24+ emailText = address . email
25+ phoneText = address . phone ?? " "
2626 billingAddressText = billingAddress
2727 }
2828
You can’t perform that action at this time.
0 commit comments