Fix empty displayName
This commit is contained in:
parent
41d7f4ca62
commit
fb0cd6b623
|
@ -10,9 +10,20 @@ extension Account {
|
|||
let value: Substring
|
||||
}
|
||||
|
||||
public var safeDisplayName: String {
|
||||
if displayName.isEmpty {
|
||||
return username
|
||||
}
|
||||
return displayName
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
public var displayNameWithEmojis: some View {
|
||||
if displayName.isEmpty {
|
||||
Text(safeDisplayName)
|
||||
}
|
||||
let splittedDisplayName = displayName.split(separator: ":").map{ Part(value: $0) }
|
||||
return HStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
if displayName.isEmpty {
|
||||
Text(" ")
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ struct NotificationRowView: View {
|
|||
private func makeMainLabel(type: Models.Notification.NotificationType) -> some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Text(notification.account.displayName)
|
||||
Text(notification.account.safeDisplayName)
|
||||
.font(.subheadline)
|
||||
.fontWeight(.semibold) +
|
||||
Text(" ") +
|
||||
|
|
Loading…
Reference in New Issue