Skip to content

Commit

Permalink
Change mediaFiles from string to a dictionary (#28766)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjtitus authored and fluiddot committed Feb 18, 2021
1 parent fbe52c4 commit 513d9b6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ public protocol GutenbergBridgeDelegate: class {
///
func gutenbergDidRequestMediaSaveSync()

func gutenbergDidRequestMediaFilesEditorLoad(_ mediaFiles: [String], blockId: String)
func gutenbergDidRequestMediaFilesEditorLoad(_ mediaFiles: [[String: Any]], blockId: String)

func gutenbergDidRequestMediaFilesFailedRetryDialog(_ mediaFiles: [String])
func gutenbergDidRequestMediaFilesFailedRetryDialog(_ mediaFiles: [[String: Any]])

func gutenbergDidRequestMediaFilesUploadCancelDialog(_ mediaFiles: [String])
func gutenbergDidRequestMediaFilesUploadCancelDialog(_ mediaFiles: [[String: Any]])

func gutenbergDidRequestMediaFilesSaveCancelDialog(_ mediaFiles: [String])
func gutenbergDidRequestMediaFilesSaveCancelDialog(_ mediaFiles: [[String: Any]])
}

// MARK: - Optional GutenbergBridgeDelegate methods
Expand All @@ -259,9 +259,9 @@ public extension GutenbergBridgeDelegate {
// Media Collection

func gutenbergDidRequestMediaSaveSync() {}
func gutenbergDidRequestMediaFilesEditorLoad(_ mediaFiles: [String], blockId: String) { }
func gutenbergDidRequestMediaFilesFailedRetryDialog(_ mediaFiles: [String]) { }
func gutenbergDidRequestMediaFilesUploadCancelDialog(_ mediaFiles: [String]) { }
func gutenbergDidRequestMediaFilesSaveCancelDialog(_ mediaFiles: [String]) { }
func gutenbergDidRequestMediaFilesEditorLoad(_ mediaFiles: [[String: Any]], blockId: String) { }
func gutenbergDidRequestMediaFilesFailedRetryDialog(_ mediaFiles: [[String: Any]]) { }
func gutenbergDidRequestMediaFilesUploadCancelDialog(_ mediaFiles: [[String: Any]]) { }
func gutenbergDidRequestMediaFilesSaveCancelDialog(_ mediaFiles: [[String: Any]]) { }
func gutenbergDidRequestMediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) {}
}
10 changes: 5 additions & 5 deletions packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ @interface RCT_EXTERN_MODULE(RNReactNativeGutenbergBridge, NSObject)
RCT_EXTERN_METHOD(requestUnsupportedBlockFallback:(NSString *)content blockId:(NSString *)blockId blockName:(NSString *)blockName blockTitle:(NSString *)blockTitle)
RCT_EXTERN_METHOD(showUserSuggestions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)rejecter)
RCT_EXTERN_METHOD(showXpostSuggestions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)rejecter)
RCT_EXTERN_METHOD(requestMediaFilesEditorLoad:(NSArray<NSString *> *)mediaFiles blockId:(NSString *)blockId)
RCT_EXTERN_METHOD(requestMediaFilesFailedRetryDialog:(NSArray<NSString *> *)mediaFiles)
RCT_EXTERN_METHOD(requestMediaFilesUploadCancelDialog:(NSArray<NSString *> *)mediaFiles)
RCT_EXTERN_METHOD(requestMediaFilesSaveCancelDialog:(NSArray<NSString *> *)mediaFiles)
RCT_EXTERN_METHOD(onCancelUploadForMediaCollection:(NSArray<NSString *> *)mediaFiles)
RCT_EXTERN_METHOD(requestMediaFilesEditorLoad:(NSArray<NSDictionary *> *)mediaFiles blockId:(NSString *)blockId)
RCT_EXTERN_METHOD(requestMediaFilesFailedRetryDialog:(NSArray<NSDictionary *> *)mediaFiles)
RCT_EXTERN_METHOD(requestMediaFilesUploadCancelDialog:(NSArray<NSDictionary *> *)mediaFiles)
RCT_EXTERN_METHOD(requestMediaFilesSaveCancelDialog:(NSArray<NSDictionary *> *)mediaFiles)
RCT_EXTERN_METHOD(onCancelUploadForMediaCollection:(NSArray<NSDictionary *> *)mediaFiles)
RCT_EXTERN_METHOD(actionButtonPressed:(NSString *)buttonType)
RCT_EXTERN_METHOD(mediaSaveSync)
RCT_EXTERN_METHOD(mediaFilesBlockReplaceSync:(NSArray<NSDictionary *> *)mediaFiles clientId:(NSString *)clientId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,28 +291,28 @@ public class RNReactNativeGutenbergBridge: RCTEventEmitter {
}

@objc
func requestMediaFilesEditorLoad(_ mediaFiles: [String], blockId: String) {
func requestMediaFilesEditorLoad(_ mediaFiles: [[String: Any]], blockId: String) {
DispatchQueue.main.async {
self.delegate?.gutenbergDidRequestMediaFilesEditorLoad(mediaFiles, blockId: blockId)
}
}

@objc
func requestMediaFilesFailedRetryDialog(_ mediaFiles: [String]) {
func requestMediaFilesFailedRetryDialog(_ mediaFiles: [[String: Any]]) {
DispatchQueue.main.async {
self.delegate?.gutenbergDidRequestMediaFilesFailedRetryDialog(mediaFiles)
}
}

@objc
func requestMediaFilesUploadCancelDialog(_ mediaFiles: [String]) {
func requestMediaFilesUploadCancelDialog(_ mediaFiles: [[String: Any]]) {
DispatchQueue.main.async {
self.delegate?.gutenbergDidRequestMediaFilesUploadCancelDialog(mediaFiles)
}
}

@objc
func requestMediaFilesSaveCancelDialog(_ mediaFiles: [String]) {
func requestMediaFilesSaveCancelDialog(_ mediaFiles: [[String: Any]]) {
DispatchQueue.main.async {
self.delegate?.gutenbergDidRequestMediaFilesSaveCancelDialog(mediaFiles)
}
Expand Down

0 comments on commit 513d9b6

Please sign in to comment.