mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 10:55:55 +03:00
Make the code a bit easier to understand (no change)
This commit is contained in:
parent
73e93e7d3d
commit
2df9b43abc
2 changed files with 12 additions and 5 deletions
|
@ -14,6 +14,7 @@ Bugfix 🐛:
|
||||||
- VoIP : fix audio devices output
|
- VoIP : fix audio devices output
|
||||||
- Fix crash after initial sync on Dendrite
|
- Fix crash after initial sync on Dendrite
|
||||||
- Fix crash reported by PlayStore (#2707)
|
- Fix crash reported by PlayStore (#2707)
|
||||||
|
- Fix crash when deactivating an account
|
||||||
|
|
||||||
Translations 🗣:
|
Translations 🗣:
|
||||||
-
|
-
|
||||||
|
|
|
@ -45,10 +45,11 @@ internal class DefaultDeactivateAccountTask @Inject constructor(
|
||||||
override suspend fun execute(params: DeactivateAccountTask.Params) {
|
override suspend fun execute(params: DeactivateAccountTask.Params) {
|
||||||
val deactivateAccountParams = DeactivateAccountParams.create(params.userAuthParam, params.eraseAllData)
|
val deactivateAccountParams = DeactivateAccountParams.create(params.userAuthParam, params.eraseAllData)
|
||||||
|
|
||||||
try {
|
val canCleanup = try {
|
||||||
executeRequest<Unit>(globalErrorReceiver) {
|
executeRequest<Unit>(globalErrorReceiver) {
|
||||||
apiCall = accountAPI.deactivate(deactivateAccountParams)
|
apiCall = accountAPI.deactivate(deactivateAccountParams)
|
||||||
}
|
}
|
||||||
|
true
|
||||||
} catch (throwable: Throwable) {
|
} catch (throwable: Throwable) {
|
||||||
if (!handleUIA(
|
if (!handleUIA(
|
||||||
failure = throwable,
|
failure = throwable,
|
||||||
|
@ -60,12 +61,17 @@ internal class DefaultDeactivateAccountTask @Inject constructor(
|
||||||
) {
|
) {
|
||||||
Timber.d("## UIA: propagate failure")
|
Timber.d("## UIA: propagate failure")
|
||||||
throw throwable
|
throw throwable
|
||||||
|
} else {
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (canCleanup) {
|
||||||
// Logout from identity server if any, ignoring errors
|
// Logout from identity server if any, ignoring errors
|
||||||
runCatching { identityDisconnectTask.execute(Unit) }
|
runCatching { identityDisconnectTask.execute(Unit) }
|
||||||
.onFailure { Timber.w(it, "Unable to disconnect identity server") }
|
.onFailure { Timber.w(it, "Unable to disconnect identity server") }
|
||||||
|
|
||||||
cleanupSession.handle()
|
cleanupSession.handle()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue