adding me to the footer and fixing toast text
This commit is contained in:
@@ -152,9 +152,19 @@ struct ConvoUsernames: View {
|
|||||||
var unknownUserCount: Int = 0
|
var unknownUserCount: Int = 0
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
let userNames = self.users.map{$0.nickname ?? ""}.joined(separator: ", ")
|
if let userId = AuthSessionStore.getCurrentUserId() {
|
||||||
Text(unknownUserCount > 0 ? "\(userNames), and \(unknownUserCount) other(s)": userNames)
|
let userNames = self.users.map{user in
|
||||||
.font(.footnote)
|
if user.id == userId {
|
||||||
.foregroundColor(NirvanaColor.light)
|
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:
|
case .connecting:
|
||||||
return AlertToast(displayMode: .hud, type: .systemImage("sensor.tag.radiowaves.forward.fill", NirvanaColor.dimTeal), title: "Connecting")
|
return AlertToast(displayMode: .hud, type: .systemImage("sensor.tag.radiowaves.forward.fill", NirvanaColor.dimTeal), title: "Connecting")
|
||||||
case .disconnected:
|
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:
|
case .successfullyAddedThirdParty:
|
||||||
return AlertToast(displayMode: .hud, type: .complete(Color.green), title: "added friend to convo")
|
return AlertToast(displayMode: .hud, type: .complete(Color.green), title: "added friend to convo")
|
||||||
case .cantAddThirdParty:
|
case .cantAddThirdParty:
|
||||||
|
|||||||
Reference in New Issue
Block a user