Skip to content

Commit 434377b

Browse files
committed
Add fallback for subscription title for JN sites
1 parent 8873de6 commit 434377b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

WordPress/Classes/ViewRelated/Reader/Subscriptions/ReaderSubscriptionCell.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ struct ReaderSubscriptionCell: View {
1111

1212
var onDelete: (ReaderSiteTopic) -> Void
1313

14+
private var displayTitle: String {
15+
if !site.title.isEmpty {
16+
return site.title
17+
}
18+
return URL(string: site.siteURL)?.host ?? site.title
19+
}
20+
1421
private var details: String {
1522
let components = [
1623
horizontalSizeClass == .compact ? nil : URL(string: site.siteURL)?.host,
@@ -27,7 +34,7 @@ struct ReaderSubscriptionCell: View {
2734

2835
VStack(alignment: .leading, spacing: 3) {
2936
HStack(alignment: .firstTextBaseline, spacing: 8) {
30-
Text(site.title)
37+
Text(displayTitle)
3138
.font(.body.weight(.medium))
3239
}
3340
Text(details)

0 commit comments

Comments
 (0)