diff options
Diffstat (limited to 'iosApp')
-rw-r--r-- | iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate | bin | 31113 -> 29011 bytes | |||
-rw-r--r-- | iosApp/iosApp/Authentication/LoginView.swift | 12 | ||||
-rw-r--r-- | iosApp/iosApp/iOSApp.swift | 19 |
3 files changed, 9 insertions, 22 deletions
diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex 56eaa32..a056117 100644 --- a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate +++ b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/iosApp/iosApp/Authentication/LoginView.swift b/iosApp/iosApp/Authentication/LoginView.swift index ba07753..7b1e63e 100644 --- a/iosApp/iosApp/Authentication/LoginView.swift +++ b/iosApp/iosApp/Authentication/LoginView.swift @@ -6,11 +6,17 @@ struct LoginContainerView: View { @State private var password = "" @State private var server = "" - private var sessionController = SessionController( - sessionApi: SessionApi(defaultBaseUrl: "https://etbsa.net/api"), - usersApi: UsersApi(defaultBaseUrl: "https://etbsa.net/api")) + private let sessionManager = SessionManager( + defaultBaseUrl: "https://etbsa.net/api" + ) + + private var sessionController: SessionController init() { + sessionController = SessionController( + sessionApi: SessionApi(sessionManager: sessionManager), + usersApi: UsersApi(sessionManager: sessionManager)) + sessionController.loginStateFlow.collect(collector: Collector<SessionController.LoginState?> { state in print("State is: \(state?.debugDescription ?? "")") }) { (unit, error) in diff --git a/iosApp/iosApp/iOSApp.swift b/iosApp/iosApp/iOSApp.swift index cbc2ffd..26c93f1 100644 --- a/iosApp/iosApp/iOSApp.swift +++ b/iosApp/iosApp/iOSApp.swift @@ -3,25 +3,6 @@ import shared @main struct iOSApp: App { - let defaultServer = "https://etbsa.net/" - - var sessionApi: SessionApi - var usersApi: UsersApi - var devicesApi: DevicesApi - var positionsApi: PositionsApi - var commandsApi: CommandsApi - var reportsApi: ReportsApi - var geofencesApi: GeofencesApi - - init() { - sessionApi = SessionApi(defaultBaseUrl: defaultServer) - usersApi = UsersApi(defaultBaseUrl: defaultServer) - devicesApi = DevicesApi(defaultBaseUrl: defaultServer) - positionsApi = PositionsApi(defaultBaseUrl: defaultServer) - commandsApi = CommandsApi(defaultBaseUrl: defaultServer) - reportsApi = ReportsApi(defaultBaseUrl: defaultServer) - geofencesApi = GeofencesApi(defaultBaseUrl: defaultServer) - } var body: some Scene { WindowGroup { |