Skip to content

Commit

Permalink
Add Stories bridge methods for iOS (#29083)
Browse files Browse the repository at this point in the history
Add missing bridge methods for the Stories block. The absence of these
threw an error, even though Stories block isn't fully supported for iOS
just yet.
  • Loading branch information
dcalhoun committed Feb 17, 2021
1 parent 0529a98 commit 93add38
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,5 @@ public extension GutenbergBridgeDelegate {
func gutenbergDidRequestMediaFilesFailedRetryDialog(_ mediaFiles: [[String: Any]]) { }
func gutenbergDidRequestMediaFilesUploadCancelDialog(_ mediaFiles: [[String: Any]]) { }
func gutenbergDidRequestMediaFilesSaveCancelDialog(_ mediaFiles: [[String: Any]]) { }
func gutenbergDidRequestMediaFilesBlockReplaceSync() {}
func gutenbergDidRequestMediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ @interface RCT_EXTERN_MODULE(RNReactNativeGutenbergBridge, NSObject)
RCT_EXTERN_METHOD(setFocalPointPickerTooltipShown:(BOOL)tooltipShown)
RCT_EXTERN_METHOD(actionButtonPressed:(NSString *)buttonType)
RCT_EXTERN_METHOD(mediaSaveSync)
RCT_EXTERN_METHOD(mediaFilesBlockReplaceSync)
RCT_EXTERN_METHOD(mediaFilesBlockReplaceSync:(NSArray<NSDictionary *> *)mediaFiles clientId:(NSString *)clientId)

@end
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ public class RNReactNativeGutenbergBridge: RCTEventEmitter {
}

@objc
func mediaFilesBlockReplaceSync() {
func mediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) {
DispatchQueue.main.async {
if self.hasObservers {
self.delegate?.gutenbergDidRequestMediaFilesBlockReplaceSync()
self.delegate?.gutenbergDidRequestMediaFilesBlockReplaceSync(mediaFiles, clientId: clientId)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ extension GutenbergViewController: GutenbergBridgeDelegate {
print(#function)
}

func gutenbergDidRequestMediaFilesBlockReplaceSync() {
func gutenbergDidRequestMediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) {
print(#function)
}

Expand Down

0 comments on commit 93add38

Please sign in to comment.