From 003ccddfa2a37b6153a4402ce32dc777c2012503 Mon Sep 17 00:00:00 2001 From: parveshneedhoo Date: Fri, 17 May 2024 11:00:10 +0400 Subject: [PATCH] refactor --- src/ios/SOSPicker.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ios/SOSPicker.m b/src/ios/SOSPicker.m index 6c311f35..3bc8839a 100644 --- a/src/ios/SOSPicker.m +++ b/src/ios/SOSPicker.m @@ -282,14 +282,13 @@ -(void)assetsPickerControllerDidCancel:(GMImagePickerController *)picker } - (void) closeImagePicker:(CDVInvokedUrlCommand *)command { - if (self.imagePicker && self.imagePicker.presentingViewController) { - [self.imagePicker.presentingViewController dismissViewControllerAnimated:YES completion:nil]; - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:TRUE]; + bool boolMessage = FALSE; + if (self.imagePicker && self.imagePicker.presentingViewController) { + [self.imagePicker.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + boolMessage = TRUE; + } + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:boolMessage]; [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } else { - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:FALSE]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } } @end