Skip to content

Commit a228424

Browse files
committed
Resolve issues
1 parent 9f59bc4 commit a228424

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/WebView.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ struct WebView: UIViewRepresentable {
1111
@Binding var isLoading: Bool
1212
@Binding var title: String?
1313
@Binding var error: Error?
14-
15-
private let WebKitErrorDomain = "WebKitErrorDomain"
16-
private enum WebKitErrorCode: Int {
17-
case pluginHandledLoad = 204
18-
}
1914

2015
func makeCoordinator() -> Coordinator {
2116
Coordinator(
@@ -44,6 +39,11 @@ struct WebView: UIViewRepresentable {
4439
var isLoading: Binding<Bool>
4540
var title: Binding<String?>
4641
var error: Binding<Error?>
42+
43+
private let WebKitErrorDomain = "WebKitErrorDomain"
44+
private enum WebKitErrorCode: Int {
45+
case pluginHandledLoad = 204
46+
}
4747

4848
init(
4949
webView: WebView,
@@ -76,7 +76,6 @@ struct WebView: UIViewRepresentable {
7676
didFailProvisionalNavigation navigation: WKNavigation!,
7777
withError error: Error
7878
) {
79-
// Ignore "Plug-in handled load" error as it's actually success for audio files
8079
let nsError = error as NSError
8180
if nsError.domain == WebKitErrorDomain && nsError.code == WebKitErrorCode.pluginHandledLoad.rawValue {
8281
return
@@ -91,7 +90,6 @@ struct WebView: UIViewRepresentable {
9190
didFail navigation: WKNavigation!,
9291
withError error: Error
9392
) {
94-
// Ignore "Plug-in handled load" error as it's actually success for audio files
9593
let nsError = error as NSError
9694
if nsError.domain == WebKitErrorDomain && nsError.code == WebKitErrorCode.pluginHandledLoad.rawValue {
9795
return

0 commit comments

Comments
 (0)