aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-20 21:57:54 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-20 21:57:54 -0600
commit1366da35eb569a9b1efdf7252adbcfbede7e32d6 (patch)
treeb2c5b743afc3e5d457f875c5e5e230dfe30a4475 /androidApp/src/main/java/mx/trackermap
parent7da841d2de9ac0526c3863e85d7d603facabb95c (diff)
downloadetbsa-trackermap-mobile-1366da35eb569a9b1efdf7252adbcfbede7e32d6.tar.gz
etbsa-trackermap-mobile-1366da35eb569a9b1efdf7252adbcfbede7e32d6.tar.bz2
etbsa-trackermap-mobile-1366da35eb569a9b1efdf7252adbcfbede7e32d6.zip
Fallback ApiClient to default URL, so pre-URL-switch-capable apps don't fail at login
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt16
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()) }