Skip to content

Commit c5de6f8

Browse files
committed
Reject promise by iOS openDocument when a file is not opened
1 parent 1f9a176 commit c5de6f8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ios/RNFetchBlob/RNFetchBlob.m

+5-2
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,12 @@ + (BOOL)requiresMainQueueSetup
588588

589589
if(scheme == nil || [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:scheme]]) {
590590
dispatch_sync(dispatch_get_main_queue(), ^{
591-
[documentController presentPreviewAnimated:YES];
591+
if([documentController presentPreviewAnimated:YES]) {
592+
resolve(@[[NSNull null]]);
593+
} else {
594+
reject(@"EINVAL", @"document is not supported", nil);
595+
}
592596
});
593-
resolve(@[[NSNull null]]);
594597
} else {
595598
reject(@"EINVAL", @"scheme is not supported", nil);
596599
}

0 commit comments

Comments
 (0)