Skip to content

Commit d4394fe

Browse files
authored
sync: less login manager is more (fixes #11395) (#11359)
1 parent 3dfe2ec commit d4394fe

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId "org.ole.planet.myplanet"
1212
minSdk = 26
1313
targetSdk = 36
14-
versionCode = 4644
15-
versionName = "0.46.44"
14+
versionCode = 4645
15+
versionName = "0.46.45"
1616
ndkVersion = '26.3.11579264'
1717
vectorDrawables.useSupportLibrary = true
1818
}

app/src/main/java/org/ole/planet/myplanet/services/sync/LoginSyncManager.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ class LoginSyncManager private constructor(
4040
withContext(Dispatchers.Main) { listener.onSyncStarted() }
4141

4242
val apiInterface = ApiClient.client.create(ApiInterface::class.java)
43-
if (apiInterface == null) {
44-
withContext(Dispatchers.Main) { listener.onSyncFailed("Network client not available.") }
45-
return@launch
46-
}
4743

4844
val authHeader = try {
4945
"Basic " + Base64.encodeToString("$userName:$password".toByteArray(), Base64.NO_WRAP)
@@ -137,9 +133,6 @@ class LoginSyncManager private constructor(
137133
`object`.add("selector", selector)
138134

139135
val apiInterface = ApiClient.client.create(ApiInterface::class.java)
140-
if (apiInterface == null) {
141-
return@launch
142-
}
143136

144137
val header = UrlUtils.header
145138
if (header.isBlank()) {
@@ -160,7 +153,7 @@ class LoginSyncManager private constructor(
160153
settings.edit { putString("communityLeaders", "$responseBody") }
161154

162155
val array = JsonUtils.getJsonArray("docs", responseBody)
163-
if (array != null && array.size() > 0) {
156+
if (array.size() > 0) {
164157
try {
165158
settings.edit { putString("user_admin", JsonUtils.gson.toJson(array[0])) }
166159
} catch (e: Exception) {

0 commit comments

Comments
 (0)