Skip to content

Commit 33d55c0

Browse files
authored
Merge pull request wkh237#41 from genabasov/0.10.9
Reject promise by iOS openDocument when a file is not opened
2 parents 9cb0f14 + c5de6f8 commit 33d55c0

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
@@ -587,9 +587,12 @@ - (NSDictionary *)constantsToExport
587587

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

0 commit comments

Comments
 (0)