1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-24 16:38:22 +01:00

fix ipad crash on doc picker

This commit is contained in:
kspearrin 2018-04-07 12:15:59 -04:00
parent 5a3d86a12a
commit 2ad709dae4

View File

@ -152,6 +152,13 @@ namespace Bit.iOS.Services
e.DocumentPicker.DidPickDocument += DocumentPicker_DidPickDocument;
};
var root = UIApplication.SharedApplication.KeyWindow.RootViewController;
if(picker.PopoverPresentationController != null && root != null)
{
picker.PopoverPresentationController.SourceView = root.View;
picker.PopoverPresentationController.SourceRect = root.View.Bounds;
}
controller.PresentViewController(picker, true, null);
return Task.FromResult(0);
}