Fix an issue where an application turns to a white screen after finishing cloudflare verification. Close #169

This commit is contained in:
2025-02-05 21:21:20 +08:00
parent 23404b86f6
commit 58d6ccdde1
2 changed files with 6 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ class _App {
BuildContext get rootContext => rootNavigatorKey.currentContext!;
void rootPop() {
rootNavigatorKey.currentState?.pop();
rootNavigatorKey.currentState?.maybePop();
}
void pop() {

View File

@@ -152,6 +152,7 @@ void passCloudflare(CloudflareException e, void Function() onFinished) async {
);
webview.open();
} else {
bool success = false;
void check(InAppWebViewController controller) async {
var head = await controller.evaluateJavascript(
source: "document.head.innerHTML") as String;
@@ -176,7 +177,10 @@ void passCloudflare(CloudflareException e, void Function() onFinished) async {
return;
}
SingleInstanceCookieJar.instance?.saveFromResponse(uri, cookies);
if (!success) {
App.rootPop();
success = true;
}
}
}