Remove unused variable & improve formatting

This commit is contained in:
Aleksi Lahikainen 2020-09-08 15:58:26 +03:00
parent d2fb6d5184
commit 68392bdaf2

View File

@ -46,7 +46,7 @@ NSString* callbackId = nil;
self.cdvViewController = cont; self.cdvViewController = cont;
NSString *uti = nil; NSString *uti = nil;
if([contentType length] == 0){ if ([contentType length] == 0) {
NSArray *dotParts = [path componentsSeparatedByString:@"."]; NSArray *dotParts = [path componentsSeparatedByString:@"."];
NSString *fileExt = [dotParts lastObject]; NSString *fileExt = [dotParts lastObject];
@ -72,7 +72,7 @@ NSString* callbackId = nil;
NSLog(@"looking for file at %@", fileURL); NSLog(@"looking for file at %@", fileURL);
NSFileManager *fm = [NSFileManager defaultManager]; NSFileManager *fm = [NSFileManager defaultManager];
if(![fm fileExistsAtPath:localFile]) { if (![fm fileExistsAtPath:localFile]) {
NSDictionary *jsonObj = @{@"status" : @"9", NSDictionary *jsonObj = @{@"status" : @"9",
@"message" : @"File does not exist"}; @"message" : @"File does not exist"};
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:jsonObj]; CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:jsonObj];
@ -84,8 +84,6 @@ NSString* callbackId = nil;
docController.delegate = self; docController.delegate = self;
docController.UTI = uti; docController.UTI = uti;
CDVPluginResult* pluginResult = nil;
//Opens the file preview //Opens the file preview
CGRect rect; CGRect rect;
@ -133,11 +131,12 @@ NSString* callbackId = nil;
- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller { - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller {
UIViewController *presentingViewController = self.viewController; UIViewController *presentingViewController = self.viewController;
if (presentingViewController.view.window != [UIApplication sharedApplication].keyWindow){
if (presentingViewController.view.window != [UIApplication sharedApplication].keyWindow) {
presentingViewController = [UIApplication sharedApplication].keyWindow.rootViewController; presentingViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
} }
while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController isBeingDismissed]){ while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController isBeingDismissed]) {
presentingViewController = presentingViewController.presentedViewController; presentingViewController = presentingViewController.presentedViewController;
} }