wip
This commit is contained in:
parent
c153985bf0
commit
473cf3b30b
|
@ -76,6 +76,10 @@ extension Client: Identifiable {
|
|||
}
|
||||
|
||||
extension Client {
|
||||
func updActivity(_ isActive: Bool) async {
|
||||
credentials.isActive = isActive
|
||||
}
|
||||
|
||||
func addRoster(_ jid: String, name: String?, groups: [String]) async throws {
|
||||
_ = try await connection.module(.roster).addItem(
|
||||
jid: JID(jid),
|
||||
|
|
|
@ -48,11 +48,13 @@ final class ClientsStore: ObservableObject {
|
|||
updatedClients.append(contentsOf: newClients)
|
||||
clients = updatedClients
|
||||
|
||||
// for creds in credentials {
|
||||
// if let client = client(for: creds) {
|
||||
// client.credentials = creds
|
||||
// }
|
||||
// }
|
||||
Task {
|
||||
for client in clients {
|
||||
if let creds = credentials.first(where: { $0.bareJid == client.credentials.bareJid }) {
|
||||
await client.updActivity(creds.isActive)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !ready {
|
||||
ready = true
|
||||
|
|
|
@ -85,11 +85,6 @@ struct SettingsScreen: View {
|
|||
Spacer()
|
||||
}
|
||||
}
|
||||
// .onDisappear {
|
||||
// if settingsStore.credentials.isEmpty || settingsStore.credentials.allSatisfy({ !$0.isActive }) {
|
||||
// router.dismissScreenStack()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@ViewBuilder private var addAccountSelector: some View {
|
||||
|
|
Loading…
Reference in a new issue