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 { override suspend fun logout(): Boolean {
val result = try { val result = try {
loginHelper.logout() loginHelper.logout()
true
} catch (e: NoSessionException) { } catch (e: NoSessionException) {
true true
} catch (e: Exception) { } catch (e: Exception) {

View File

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