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/).
33
44# Upcoming
55
6- ### 🔄 Changed
6+ ### 🐞 Fixed
7+ - Fix WebView error handling to enable mp3 attachments loading [ #904 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/904 )
78
89# [ 4.83.0] ( https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.83.0 )
910_ July 29, 2025_
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ struct WebView: UIViewRepresentable {
7171 didFailProvisionalNavigation navigation: WKNavigation ! ,
7272 withError error: Error
7373 ) {
74+ if isPluginHandledLoadResult ( error) {
75+ return
76+ }
77+
7478 isLoading. wrappedValue = false
7579 self . error. wrappedValue = error
7680 }
@@ -80,8 +84,17 @@ struct WebView: UIViewRepresentable {
8084 didFail navigation: WKNavigation ! ,
8185 withError error: Error
8286 ) {
87+ if isPluginHandledLoadResult ( error) {
88+ return
89+ }
90+
8391 isLoading. wrappedValue = false
8492 self . error. wrappedValue = error
8593 }
94+
95+ private func isPluginHandledLoadResult( _ error: Error ) -> Bool {
96+ let nsError = error as NSError
97+ return nsError. domain == " WebKitErrorDomain " && nsError. code == 204
98+ }
8699 }
87100}
You can’t perform that action at this time.
0 commit comments