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