mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 18:21:00 +00:00
Fix empty displayName
This commit is contained in:
parent
41d7f4ca62
commit
fb0cd6b623
2 changed files with 13 additions and 2 deletions
|
@ -10,9 +10,20 @@ extension Account {
|
||||||
let value: Substring
|
let value: Substring
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var safeDisplayName: String {
|
||||||
|
if displayName.isEmpty {
|
||||||
|
return username
|
||||||
|
}
|
||||||
|
return displayName
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
public var displayNameWithEmojis: some View {
|
public var displayNameWithEmojis: some View {
|
||||||
|
if displayName.isEmpty {
|
||||||
|
Text(safeDisplayName)
|
||||||
|
}
|
||||||
let splittedDisplayName = displayName.split(separator: ":").map{ Part(value: $0) }
|
let splittedDisplayName = displayName.split(separator: ":").map{ Part(value: $0) }
|
||||||
return HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
if displayName.isEmpty {
|
if displayName.isEmpty {
|
||||||
Text(" ")
|
Text(" ")
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct NotificationRowView: View {
|
||||||
private func makeMainLabel(type: Models.Notification.NotificationType) -> some View {
|
private func makeMainLabel(type: Models.Notification.NotificationType) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
Text(notification.account.displayName)
|
Text(notification.account.safeDisplayName)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.fontWeight(.semibold) +
|
.fontWeight(.semibold) +
|
||||||
Text(" ") +
|
Text(" ") +
|
||||||
|
|
Loading…
Reference in a new issue