mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +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
|
||||
- Fix crash after initial sync on Dendrite
|
||||
- Fix crash reported by PlayStore (#2707)
|
||||
- Fix crash when deactivating an account
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
|
|
@ -45,10 +45,11 @@ internal class DefaultDeactivateAccountTask @Inject constructor(
|
|||
override suspend fun execute(params: DeactivateAccountTask.Params) {
|
||||
val deactivateAccountParams = DeactivateAccountParams.create(params.userAuthParam, params.eraseAllData)
|
||||
|
||||
try {
|
||||
val canCleanup = try {
|
||||
executeRequest<Unit>(globalErrorReceiver) {
|
||||
apiCall = accountAPI.deactivate(deactivateAccountParams)
|
||||
}
|
||||
true
|
||||
} catch (throwable: Throwable) {
|
||||
if (!handleUIA(
|
||||
failure = throwable,
|
||||
|
@ -60,12 +61,17 @@ internal class DefaultDeactivateAccountTask @Inject constructor(
|
|||
) {
|
||||
Timber.d("## UIA: propagate failure")
|
||||
throw throwable
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
// Logout from identity server if any, ignoring errors
|
||||
runCatching { identityDisconnectTask.execute(Unit) }
|
||||
.onFailure { Timber.w(it, "Unable to disconnect identity server") }
|
||||
|
||||
cleanupSession.handle()
|
||||
if (canCleanup) {
|
||||
// Logout from identity server if any, ignoring errors
|
||||
runCatching { identityDisconnectTask.execute(Unit) }
|
||||
.onFailure { Timber.w(it, "Unable to disconnect identity server") }
|
||||
|
||||
cleanupSession.handle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue