Skip to content

Commit

Permalink
fix(ios): only show popover presentation style if popover view exists (
Browse files Browse the repository at this point in the history
…#13803)

* fix(ios): only show popover presentation style if popover view exists

* fix: handle existing view controller state gracefully
  • Loading branch information
hansemannn committed Apr 18, 2023
1 parent 48a6342 commit 74f9296
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions iphone/Classes/MediaModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -1470,10 +1470,12 @@ - (void)displayModalPicker:(UIViewController *)picker_ settings:(NSDictionary *)
- (void)updatePopoverNow:(UIViewController *)picker_
{
UIViewController *theController = picker_;
[theController setModalPresentationStyle:UIModalPresentationPopover];
UIPopoverPresentationController *thePresenter = [theController popoverPresentationController];
[thePresenter setPermittedArrowDirections:arrowDirection];
[thePresenter setDelegate:self];
if (self.popoverView != nil) {
[theController setModalPresentationStyle:UIModalPresentationPopover];
UIPopoverPresentationController *thePresenter = [theController popoverPresentationController];
[thePresenter setPermittedArrowDirections:arrowDirection];
[thePresenter setDelegate:self];
}
[[TiApp app] showModalController:theController animated:animatedPicker];
return;
}
Expand Down Expand Up @@ -1736,8 +1738,7 @@ - (void)handleTrimmedVideo:(NSURL *)theURL withDictionary:(NSDictionary *)dictio
- (void)showPHPicker:(NSDictionary *)args
{
if (_phPicker != nil) {
[self sendPickerError:MediaModuleErrorBusy];
return;
[self destroyPicker];
}

animatedPicker = YES;
Expand Down

0 comments on commit 74f9296

Please sign in to comment.