|
|
|
|
@ -6,6 +6,9 @@ import androidx.activity.result.ActivityResultLauncher
|
|
|
|
|
import androidx.annotation.StringRes
|
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
|
import androidx.fragment.app.FragmentActivity
|
|
|
|
|
import kotlin.coroutines.Continuation
|
|
|
|
|
import kotlin.coroutines.resume
|
|
|
|
|
import kotlin.coroutines.suspendCoroutine
|
|
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
|
|
|
|
import org.koitharu.kotatsu.R
|
|
|
|
|
import org.koitharu.kotatsu.browser.BrowserActivity
|
|
|
|
|
@ -17,9 +20,6 @@ import org.koitharu.kotatsu.parsers.model.MangaSource
|
|
|
|
|
import org.koitharu.kotatsu.settings.sources.auth.SourceAuthActivity
|
|
|
|
|
import org.koitharu.kotatsu.utils.TaggedActivityResult
|
|
|
|
|
import org.koitharu.kotatsu.utils.isSuccess
|
|
|
|
|
import kotlin.coroutines.Continuation
|
|
|
|
|
import kotlin.coroutines.resume
|
|
|
|
|
import kotlin.coroutines.suspendCoroutine
|
|
|
|
|
|
|
|
|
|
class ExceptionResolver private constructor(
|
|
|
|
|
private val activity: FragmentActivity?,
|
|
|
|
|
@ -65,7 +65,7 @@ class ExceptionResolver private constructor(
|
|
|
|
|
cont.invokeOnCancellation {
|
|
|
|
|
continuations.remove(CloudFlareDialog.TAG, cont)
|
|
|
|
|
fm.clearFragmentResultListener(CloudFlareDialog.TAG)
|
|
|
|
|
dialog.dismiss()
|
|
|
|
|
dialog.dismissAllowingStateLoss()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -94,4 +94,4 @@ class ExceptionResolver private constructor(
|
|
|
|
|
|
|
|
|
|
fun canResolve(e: Throwable) = getResolveStringId(e) != 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|