File tree 1 file changed +12
-3
lines changed
react-native-gutenberg-bridge/ios
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,7 @@ public class RNReactNativeGutenbergBridge: RCTEventEmitter {
35
35
}
36
36
37
37
let jsFormattedMedia = mediaToReturn. map { mediaInfo in
38
- return [ mediaDictKeys. IDKey: mediaInfo. id as Any ,
39
- mediaDictKeys. URLKey: mediaInfo. url as Any ,
40
- mediaDictKeys. TypeKey: mediaInfo. type as Any ]
38
+ return mediaInfo. encodeForJS ( )
41
39
}
42
40
if allowMultipleSelection {
43
41
callback ( [ jsFormattedMedia] )
@@ -202,3 +200,14 @@ extension RNReactNativeGutenbergBridge {
202
200
static let TypeKey = " type "
203
201
}
204
202
}
203
+
204
+ extension MediaInfo {
205
+
206
+ func encodeForJS( ) -> [ String : Any ] {
207
+ return [
208
+ RNReactNativeGutenbergBridge . mediaDictKeys. IDKey: id as Any ,
209
+ RNReactNativeGutenbergBridge . mediaDictKeys. URLKey: url as Any ,
210
+ RNReactNativeGutenbergBridge . mediaDictKeys. TypeKey: type as Any
211
+ ]
212
+ }
213
+ }
You can’t perform that action at this time.
0 commit comments