From 0acacb9c2d3449e5ef85c3a40f3d8668eecfd762 Mon Sep 17 00:00:00 2001 From: parveshneedhoo Date: Thu, 23 May 2024 15:11:17 +0400 Subject: [PATCH] fix picker bug --- src/ios/SOSPicker.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ios/SOSPicker.m b/src/ios/SOSPicker.m index 3bc8839a..83dc60b7 100644 --- a/src/ios/SOSPicker.m +++ b/src/ios/SOSPicker.m @@ -83,7 +83,6 @@ - (void)launchGMImagePicker:(bool)allow_video title:(NSString *)title message:(N picker.colsInPortrait = 4; picker.colsInLandscape = 6; picker.minimumInteritemSpacing = 2.0; - self.imagePicker = picker; if(!disable_popover) { picker.modalPresentationStyle = UIModalPresentationPopover; @@ -283,8 +282,8 @@ -(void)assetsPickerControllerDidCancel:(GMImagePickerController *)picker - (void) closeImagePicker:(CDVInvokedUrlCommand *)command { bool boolMessage = FALSE; - if (self.imagePicker && self.imagePicker.presentingViewController) { - [self.imagePicker.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + if (self.viewController != nil) { + [self.viewController dismissViewControllerAnimated:YES completion:nil]; boolMessage = TRUE; } CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:boolMessage];