aboutsummaryrefslogtreecommitdiff
path: root/iosApp
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-26 16:30:51 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-26 16:30:51 -0600
commite369918a12347884898d7c3e9bebf92731db55d5 (patch)
tree89fde7b7db1692c4c0b04d3df0593374710ca1bd /iosApp
parentb4785c42aa026a561674257955a7c59b8c964e6f (diff)
downloadetbsa-trackermap-mobile-e369918a12347884898d7c3e9bebf92731db55d5.tar.gz
etbsa-trackermap-mobile-e369918a12347884898d7c3e9bebf92731db55d5.tar.bz2
etbsa-trackermap-mobile-e369918a12347884898d7c3e9bebf92731db55d5.zip
Disabled automatic storage of cookies in iOS engine (https://youtrack.jetbrains.com/issue/KTOR-3748), so we can handle them manually.
Diffstat (limited to 'iosApp')
-rw-r--r--iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstatebin31113 -> 29011 bytes
-rw-r--r--iosApp/iosApp/Authentication/LoginView.swift12
-rw-r--r--iosApp/iosApp/iOSApp.swift19
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
index 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
Binary files differ
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 {