Logout even if the logout response doesnt return ok

This commit is contained in:
Jobobby04 2021-07-18 13:05:35 -04:00
parent 09ea9deb67
commit dee3abd0c3
2 changed files with 5 additions and 2 deletions

View File

@ -211,6 +211,7 @@ class MangaDex(delegate: HttpSource, val context: Context) :
override suspend fun logout(): Boolean {
val result = try {
loginHelper.logout()
true
} catch (e: NoSessionException) {
true
} catch (e: Exception) {

View File

@ -61,7 +61,9 @@ class MangaDexLoginHelper(val authServiceLazy: Lazy<MangaDexAuthService>, val pr
return login(username, password)
}
suspend fun logout(): Boolean {
return authService.logout().result == "ok"
suspend fun logout() {
return withIOContext {
authService.logout()
}
}
}