File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Sources/StreamChatSwiftUI/ChatChannel/MessageList Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3
3
4
4
# Upcoming
5
5
6
- ### 🔄 Changed
6
+ ### 🐞 Fixed
7
+ - Fix WebView error handling to enable mp3 attachments loading [ #904 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/904 )
7
8
8
9
# [ 4.83.0] ( https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.83.0 )
9
10
_ July 29, 2025_
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ struct WebView: UIViewRepresentable {
71
71
didFailProvisionalNavigation navigation: WKNavigation ! ,
72
72
withError error: Error
73
73
) {
74
+ if isPluginHandledLoadResult ( error) {
75
+ return
76
+ }
77
+
74
78
isLoading. wrappedValue = false
75
79
self . error. wrappedValue = error
76
80
}
@@ -80,8 +84,17 @@ struct WebView: UIViewRepresentable {
80
84
didFail navigation: WKNavigation ! ,
81
85
withError error: Error
82
86
) {
87
+ if isPluginHandledLoadResult ( error) {
88
+ return
89
+ }
90
+
83
91
isLoading. wrappedValue = false
84
92
self . error. wrappedValue = error
85
93
}
94
+
95
+ private func isPluginHandledLoadResult( _ error: Error ) -> Bool {
96
+ let nsError = error as NSError
97
+ return nsError. domain == " WebKitErrorDomain " && nsError. code == 204
98
+ }
86
99
}
87
100
}
You can’t perform that action at this time.
0 commit comments