ios: fix double unread status (#1629)

This commit is contained in:
Evgeny Poberezkin
2022-12-23 09:14:12 +00:00
committed by GitHub
parent a2e1b7ae0a
commit 2b9238144b
2 changed files with 4 additions and 5 deletions
@@ -23,7 +23,7 @@ struct CIMetaView: View {
}
}
func ciMetaText(_ meta: CIMeta, chatTTL: Int?, color: Color = .clear) -> Text {
func ciMetaText(_ meta: CIMeta, chatTTL: Int?, color: Color = .clear, transparent: Bool = false) -> Text {
var r = Text("")
if meta.itemEdited {
r = r + statusIconText("pencil", color)
@@ -36,8 +36,8 @@ func ciMetaText(_ meta: CIMeta, chatTTL: Int?, color: Color = .clear) -> Text {
}
r = r + Text(" ")
}
if let (icon, color) = meta.statusIcon(color) {
r = r + statusIconText(icon, color) + Text(" ")
if let (icon, statusColor) = meta.statusIcon(color) {
r = r + statusIconText(icon, transparent ? .clear : statusColor) + Text(" ")
} else if !meta.disappearing {
r = r + statusIconText("circlebadge.fill", .clear) + Text(" ")
}
@@ -80,8 +80,7 @@ struct MsgContentView: View {
}
private func reserveSpaceForMeta(_ mt: CIMeta) -> Text {
(rightToLeft ? Text("\n") : Text(" ")) + ciMetaText(mt, chatTTL: chat.chatInfo.timedMessagesTTL)
.foregroundColor(.clear)
(rightToLeft ? Text("\n") : Text(" ")) + ciMetaText(mt, chatTTL: chat.chatInfo.timedMessagesTTL, transparent: true)
}
}