diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-20 21:57:54 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-20 21:57:54 -0600 |
commit | 1cc10b903ccf0b97e66fd3d412e1f53d6850f2d8 (patch) | |
tree | b2c5b743afc3e5d457f875c5e5e230dfe30a4475 /androidApp/src/main | |
parent | a7f4a31dcdb1a13ef01db3ce362fd48ed44e0278 (diff) | |
download | etbsa-trackermap-mobile-1cc10b903ccf0b97e66fd3d412e1f53d6850f2d8.tar.gz etbsa-trackermap-mobile-1cc10b903ccf0b97e66fd3d412e1f53d6850f2d8.tar.bz2 etbsa-trackermap-mobile-1cc10b903ccf0b97e66fd3d412e1f53d6850f2d8.zip |
Fallback ApiClient to default URL, so pre-URL-switch-capable apps don't fail at login
Diffstat (limited to 'androidApp/src/main')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt index 2901dbb..c21cfe1 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt @@ -1,6 +1,7 @@ package mx.trackermap.TrackerMap.android import android.app.Application +import androidx.preference.PreferenceManager import kotlinx.coroutines.DelicateCoroutinesApi import mx.trackermap.TrackerMap.android.details.commands.UnitCommandsViewModel import mx.trackermap.TrackerMap.android.details.information.UnitInformationViewModel @@ -29,13 +30,14 @@ open class TrackerApp : Application() { super.onCreate() val appModule = module { - factory { SessionApi() } - factory { UsersApi() } - factory { DevicesApi() } - factory { PositionsApi() } - factory { CommandsApi() } - factory { ReportsApi() } - factory { GeofencesApi() } + single { getString(R.string.default_server_url) } + factory { SessionApi(get()) } + factory { UsersApi(get()) } + factory { DevicesApi(get()) } + factory { PositionsApi(get()) } + factory { CommandsApi(get()) } + factory { ReportsApi(get()) } + factory { GeofencesApi(get()) } factory { SessionController(get(), get()) } factory { UnitsController(get(), get()) } |