Skip to content

Commit a8a974c

Browse files
authored
Merge pull request #773 from synonymdev/fix/bitrefill-close
fix: don't close store on sub-resource errors
2 parents 1767828 + 56d95bb commit a8a974c

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

app/src/main/java/to/bitkit/ui/screens/shop/shopDiscover/MapWebViewClient.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ class MapWebViewClient(
3838
)
3939
onLoadingStateChanged(false)
4040

41-
error?.let {
42-
if (it.errorCode == ERROR_HOST_LOOKUP ||
43-
it.errorCode == ERROR_CONNECT ||
44-
it.errorCode == ERROR_TIMEOUT ||
45-
it.errorCode == ERROR_FILE_NOT_FOUND
46-
) {
47-
onError?.invoke()
41+
if (request?.isForMainFrame == true) {
42+
error?.let {
43+
if (it.errorCode == ERROR_HOST_LOOKUP ||
44+
it.errorCode == ERROR_CONNECT ||
45+
it.errorCode == ERROR_TIMEOUT ||
46+
it.errorCode == ERROR_FILE_NOT_FOUND
47+
) {
48+
onError?.invoke()
49+
}
4850
}
4951
}
5052
}

app/src/main/java/to/bitkit/ui/screens/shop/shopWebView/ShopWebViewClient.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ class ShopWebViewClient(
6262
)
6363
onLoadingStateChanged(false)
6464

65-
error?.let {
66-
if (it.errorCode == ERROR_HOST_LOOKUP ||
67-
it.errorCode == ERROR_CONNECT ||
68-
it.errorCode == ERROR_TIMEOUT ||
69-
it.errorCode == ERROR_FILE_NOT_FOUND
70-
) {
71-
onError()
65+
if (request?.isForMainFrame == true) {
66+
error?.let {
67+
if (it.errorCode == ERROR_HOST_LOOKUP ||
68+
it.errorCode == ERROR_CONNECT ||
69+
it.errorCode == ERROR_TIMEOUT ||
70+
it.errorCode == ERROR_FILE_NOT_FOUND
71+
) {
72+
onError()
73+
}
7274
}
7375
}
7476
}

0 commit comments

Comments
 (0)