adding me to the footer and fixing toast text

This commit is contained in:
talksik
2022-01-02 01:45:20 -08:00
parent 6ed1e39919
commit 3df3d4a246
2 changed files with 15 additions and 5 deletions
+14 -4
View File
@@ -152,9 +152,19 @@ struct ConvoUsernames: View {
var unknownUserCount: Int = 0
var body: some View {
let userNames = self.users.map{$0.nickname ?? ""}.joined(separator: ", ")
Text(unknownUserCount > 0 ? "\(userNames), and \(unknownUserCount) other(s)": userNames)
.font(.footnote)
.foregroundColor(NirvanaColor.light)
if let userId = AuthSessionStore.getCurrentUserId() {
let userNames = self.users.map{user in
if user.id == userId {
return "me"
}
return user.nickname ?? ""
}.joined(separator: ", ")
Text(unknownUserCount > 0 ? "\(userNames), and \(unknownUserCount) other(s)": userNames)
.foregroundColor(NirvanaColor.light)
}
else {
EmptyView()
}
}
}
@@ -35,7 +35,7 @@ class ConvoViewModel: NSObject, ObservableObject {
case .connecting:
return AlertToast(displayMode: .hud, type: .systemImage("sensor.tag.radiowaves.forward.fill", NirvanaColor.dimTeal), title: "Connecting")
case .disconnected:
return AlertToast(displayMode: .hud, type: .systemImage("hand.wave.fill", Color.orange), title: "disconnected")
return AlertToast(displayMode: .hud, type: .systemImage("hand.wave.fill", Color.orange), title: "bye!")
case .successfullyAddedThirdParty:
return AlertToast(displayMode: .hud, type: .complete(Color.green), title: "added friend to convo")
case .cantAddThirdParty: