Better way to logout
This commit is contained in:
parent
d5423caf91
commit
ae99b733e7
@ -74,13 +74,14 @@ class MangaDexLoginHelper(val authServiceLazy: Lazy<MangaDexAuthService>, val pr
|
|||||||
return withIOContext {
|
return withIOContext {
|
||||||
try {
|
try {
|
||||||
coroutineScope {
|
coroutineScope {
|
||||||
launch {
|
var delayJob: Job? = null
|
||||||
|
val loginJob = launch {
|
||||||
authService.logout()
|
authService.logout()
|
||||||
cancel()
|
delayJob?.cancel()
|
||||||
}
|
}
|
||||||
launch {
|
delayJob = launch {
|
||||||
delay(30.seconds)
|
delay(30.seconds)
|
||||||
cancel()
|
loginJob.cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user