Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/funny-buses-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-native-documents/viewer": patch
---

fix: improve error message
3 changes: 1 addition & 2 deletions packages/document-viewer/ios/RNDocumentViewer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ - (void)presentPreview:(NSString *)title
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject {
RNDPreviewItem *item = [[RNDPreviewItem alloc] initWithURL:restoredURL title:title];

dispatch_async(dispatch_get_main_queue(), ^{
QLPreviewController *controller = [[RNDPreviewController alloc] initWithPreviewItem:item];
controller.modalPresentationStyle = presentationStyle;
Expand All @@ -85,7 +84,7 @@ - (void)presentPreview:(NSString *)title
}
} else {
[self.presentedUrl stopAccessingSecurityScopedResource];
reject(RNDocViewerErrorUnableToOpenFileType, @"unsupported file", nil);
reject(RNDocViewerErrorUnableToOpenFileType, @"QLPreviewController cannot preview this file. It may not be supported, or deleted.", nil);
}
});
}
Expand Down
Loading