Skip to content

Commit 2ab26f6

Browse files
committed
Hide empty product name in summary text
1 parent c39e044 commit 2ab26f6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WooCommerce/Classes/Extensions/Booking+Helpers.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ import struct Yosemite.Booking
44
extension Booking {
55

66
var summaryText: String {
7-
let productName = orderInfo?.productInfo?.name ?? "-"
7+
let productName = orderInfo?.productInfo?.name
88
let customerName: String = {
99
guard let name = orderInfo?.customerInfo?.billingAddress.fullName else {
1010
return Localization.guest
1111
}
1212
return name.isEmpty ? Localization.guest : name
1313
}()
14-
return [productName, customerName].joined(separator: "")
14+
return [productName, customerName]
15+
.compactMap { $0 }
16+
.joined(separator: "")
1517
}
1618

1719
private enum Localization {

0 commit comments

Comments
 (0)