mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Fix an issue where an application turns to a white screen after finishing cloudflare verification. Close #169
This commit is contained in:
@@ -52,7 +52,7 @@ class _App {
|
|||||||
BuildContext get rootContext => rootNavigatorKey.currentContext!;
|
BuildContext get rootContext => rootNavigatorKey.currentContext!;
|
||||||
|
|
||||||
void rootPop() {
|
void rootPop() {
|
||||||
rootNavigatorKey.currentState?.pop();
|
rootNavigatorKey.currentState?.maybePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void pop() {
|
void pop() {
|
||||||
|
@@ -152,6 +152,7 @@ void passCloudflare(CloudflareException e, void Function() onFinished) async {
|
|||||||
);
|
);
|
||||||
webview.open();
|
webview.open();
|
||||||
} else {
|
} else {
|
||||||
|
bool success = false;
|
||||||
void check(InAppWebViewController controller) async {
|
void check(InAppWebViewController controller) async {
|
||||||
var head = await controller.evaluateJavascript(
|
var head = await controller.evaluateJavascript(
|
||||||
source: "document.head.innerHTML") as String;
|
source: "document.head.innerHTML") as String;
|
||||||
@@ -176,7 +177,10 @@ void passCloudflare(CloudflareException e, void Function() onFinished) async {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SingleInstanceCookieJar.instance?.saveFromResponse(uri, cookies);
|
SingleInstanceCookieJar.instance?.saveFromResponse(uri, cookies);
|
||||||
|
if (!success) {
|
||||||
App.rootPop();
|
App.rootPop();
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user