Login is now working

This commit is contained in:
Rasmus Krämer
2022-04-11 18:31:14 +02:00
parent a0ee82bb31
commit 6de4626239
5 changed files with 41 additions and 14 deletions
+13 -2
View File
@@ -50,12 +50,23 @@ public class AbsDatabase: CAPPlugin {
config.token = token
Store.serverConfig = config
call.resolve(serverConnectionConfigToJSON(config: config))
call.resolve(convertServerConnectionConfigToJSON(config: config))
}
}
@objc func getDeviceData(_ call: CAPPluginCall) {
Database.realmQueue.sync {
call.resolve(serverConnectionConfigToJSON(config: Store.serverConfig))
let configs = Database.getServerConnectionConfigs()
let index = Database.getActiveServerConfigIndex()
call.resolve([
"serverConnectionConfigs": configs.map { config in
return convertServerConnectionConfigToJSON(config: config)
},
"lastServerConnectionConfigId": index < 0 ? -1 : configs[index].id,
"currentLocalPlaybackSession": nil, // Luckily this isn't implemented yet
])
}
}
}