mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix breakage in share extension.
This commit is contained in:
parent
0efb960323
commit
81f234f6a0
|
@ -150,7 +150,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
if (OWSWindowManager.sharedManager.hasCall) {
|
||||
if (!CurrentAppContext().isMainApp) {
|
||||
return super.preferredStatusBarStyle;
|
||||
} else if (OWSWindowManager.sharedManager.hasCall) {
|
||||
// Status bar is overlaying the green "call banner"
|
||||
return UIStatusBarStyleLightContent;
|
||||
} else {
|
||||
|
@ -170,7 +172,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[UIView setAnimationsEnabled:NO];
|
||||
|
||||
if (@available(iOS 11.0, *)) {
|
||||
if (OWSWindowManager.sharedManager.hasCall) {
|
||||
if (!CurrentAppContext().isMainApp) {
|
||||
self.additionalSafeAreaInsets = UIEdgeInsetsZero;
|
||||
} else if (OWSWindowManager.sharedManager.hasCall) {
|
||||
self.additionalSafeAreaInsets = UIEdgeInsetsMake(20, 0, 0, 0);
|
||||
} else {
|
||||
self.additionalSafeAreaInsets = UIEdgeInsetsZero;
|
||||
|
|
|
@ -157,10 +157,12 @@ public class OWSNavigationBar: UINavigationBar {
|
|||
}
|
||||
|
||||
public override func layoutSubviews() {
|
||||
if CurrentAppContext().isMainApp {
|
||||
guard OWSWindowManager.shared().hasCall() else {
|
||||
super.layoutSubviews()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
guard #available(iOS 11, *) else {
|
||||
super.layoutSubviews()
|
||||
|
|
|
@ -86,7 +86,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
_incomingMessageFinder = [[OWSIncomingMessageFinder alloc] initWithPrimaryStorage:primaryStorage];
|
||||
|
||||
OWSSingletonAssert();
|
||||
OWSAssertDebug(CurrentAppContext().isMainApp);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
private var progressPoller: ProgressPoller?
|
||||
var loadViewController: SAELoadViewController?
|
||||
|
||||
let shareViewNavigationController: OWSNavigationController = OWSNavigationController()
|
||||
private var shareViewNavigationController: OWSNavigationController?
|
||||
|
||||
override open func loadView() {
|
||||
super.loadView()
|
||||
|
@ -70,6 +70,9 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
return
|
||||
}
|
||||
|
||||
let shareViewNavigationController = OWSNavigationController()
|
||||
self.shareViewNavigationController = shareViewNavigationController
|
||||
|
||||
let loadViewController = SAELoadViewController(delegate: self)
|
||||
self.loadViewController = loadViewController
|
||||
|
||||
|
@ -452,6 +455,10 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
// If user is registered, do nothing.
|
||||
return
|
||||
}
|
||||
guard let shareViewNavigationController = shareViewNavigationController else {
|
||||
owsFailDebug("Missing shareViewNavigationController")
|
||||
return
|
||||
}
|
||||
guard let firstViewController = shareViewNavigationController.viewControllers.first else {
|
||||
// If no view has been presented yet, do nothing.
|
||||
return
|
||||
|
@ -513,6 +520,10 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
private func showPrimaryViewController(_ viewController: UIViewController) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
guard let shareViewNavigationController = shareViewNavigationController else {
|
||||
owsFailDebug("Missing shareViewNavigationController")
|
||||
return
|
||||
}
|
||||
shareViewNavigationController.setViewControllers([viewController], animated: false)
|
||||
if self.presentedViewController == nil {
|
||||
Logger.debug("presenting modally: \(viewController)")
|
||||
|
|
Loading…
Reference in a new issue