File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
core/tauri/mobile/ios-api/Sources/Tauri Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri " : ' patch:enhance'
3+ ---
4+
5+ Fixed the deserialisation of a ` Channel ` in iOS.
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ let channelDataKey = CodingUserInfoKey(rawValue: "sendChannelData")!
99
1010public class Channel : Decodable {
1111 public let id : UInt64
12- let handler : ( String ) -> Void
12+ let handler : ( UInt64 , String ) -> Void
1313
1414 public required init ( from decoder: Decoder ) throws {
1515 let container = try decoder. singleValueContainer ( )
@@ -30,7 +30,7 @@ public class Channel: Decodable {
3030 )
3131 }
3232
33- guard let handler = decoder. userInfo [ channelDataKey] as? ( String ) -> Void else {
33+ guard let handler = decoder. userInfo [ channelDataKey] as? ( UInt64 , String ) -> Void else {
3434 throw DecodingError . dataCorruptedError (
3535 in: container,
3636 debugDescription: " missing userInfo for Channel handler. This is a Tauri issue "
@@ -54,12 +54,12 @@ public class Channel: Decodable {
5454 }
5555
5656 public func send( _ data: JsonValue ) {
57- handler ( serialize ( data) )
57+ handler ( id , serialize ( data) )
5858 }
5959
6060 public func send< T: Encodable > ( _ data: T ) throws {
6161 let json = try JSONEncoder ( ) . encode ( data)
62- handler ( String ( decoding: json, as: UTF8 . self) )
62+ handler ( id , String ( decoding: json, as: UTF8 . self) )
6363 }
6464
6565}
You can’t perform that action at this time.
0 commit comments