From ee784d28327eb5558111e50ac71a699a6d27bd64 Mon Sep 17 00:00:00 2001 From: Aleksandr Zhukov Date: Tue, 25 Jul 2023 21:48:08 +0400 Subject: [PATCH] Don't fail auth flow in case of non-MainFrame error --- .../auth/view/ui/widget/AuthSocialWebViewClient.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/androidHyperskillApp/src/main/java/org/hyperskill/app/android/auth/view/ui/widget/AuthSocialWebViewClient.kt b/androidHyperskillApp/src/main/java/org/hyperskill/app/android/auth/view/ui/widget/AuthSocialWebViewClient.kt index 1e06c22030..56bd8cb30d 100644 --- a/androidHyperskillApp/src/main/java/org/hyperskill/app/android/auth/view/ui/widget/AuthSocialWebViewClient.kt +++ b/androidHyperskillApp/src/main/java/org/hyperskill/app/android/auth/view/ui/widget/AuthSocialWebViewClient.kt @@ -56,12 +56,14 @@ class AuthSocialWebViewClient( request: WebResourceRequest?, error: WebResourceError? ) { - onNewMessage( - AuthSocialWebViewFeature.Message.AuthCodeFailure( - socialError = AuthSocialError.CONNECTION_PROBLEM, - originalError = if (error != null) Exception(error.description.toString()) else null + if (request?.isForMainFrame == true) { + onNewMessage( + AuthSocialWebViewFeature.Message.AuthCodeFailure( + socialError = AuthSocialError.CONNECTION_PROBLEM, + originalError = if (error != null) Exception(error.description.toString()) else null + ) ) - ) + } } override fun onPageFinished(view: WebView?, url: String?) {