Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ios/RNFileViewerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ - (void)previewControllerDidDismiss:(CustomQLViewController *)controller {
controller.delegate = self;

typeof(self) __weak weakSelf = self;
[[RNFileViewer topViewController] presentViewController:controller animated:YES completion:^{
[weakSelf sendEventWithName:OPEN_EVENT body: @{@"id": invocationId}];
}];
if([QLPreviewController canPreviewItem:file]) {
[[RNFileViewer topViewController] presentViewController:controller animated:YES completion:^{
[weakSelf sendEventWithName:OPEN_EVENT body: @{@"id": invocationId}];
}];
} else {
[weakSelf sendEventWithName:OPEN_EVENT body: @{@"id": invocationId, @"error": @"File not supported"}];
}
}

@end