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
|
- (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"
|
// Status bar is overlaying the green "call banner"
|
||||||
return UIStatusBarStyleLightContent;
|
return UIStatusBarStyleLightContent;
|
||||||
} else {
|
} else {
|
||||||
|
@ -170,7 +172,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
[UIView setAnimationsEnabled:NO];
|
[UIView setAnimationsEnabled:NO];
|
||||||
|
|
||||||
if (@available(iOS 11.0, *)) {
|
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);
|
self.additionalSafeAreaInsets = UIEdgeInsetsMake(20, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
self.additionalSafeAreaInsets = UIEdgeInsetsZero;
|
self.additionalSafeAreaInsets = UIEdgeInsetsZero;
|
||||||
|
|
|
@ -157,9 +157,11 @@ public class OWSNavigationBar: UINavigationBar {
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func layoutSubviews() {
|
public override func layoutSubviews() {
|
||||||
guard OWSWindowManager.shared().hasCall() else {
|
if CurrentAppContext().isMainApp {
|
||||||
super.layoutSubviews()
|
guard OWSWindowManager.shared().hasCall() else {
|
||||||
return
|
super.layoutSubviews()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
guard #available(iOS 11, *) else {
|
guard #available(iOS 11, *) else {
|
||||||
|
|
|
@ -86,7 +86,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
_incomingMessageFinder = [[OWSIncomingMessageFinder alloc] initWithPrimaryStorage:primaryStorage];
|
_incomingMessageFinder = [[OWSIncomingMessageFinder alloc] initWithPrimaryStorage:primaryStorage];
|
||||||
|
|
||||||
OWSSingletonAssert();
|
OWSSingletonAssert();
|
||||||
OWSAssertDebug(CurrentAppContext().isMainApp);
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
||||||
private var progressPoller: ProgressPoller?
|
private var progressPoller: ProgressPoller?
|
||||||
var loadViewController: SAELoadViewController?
|
var loadViewController: SAELoadViewController?
|
||||||
|
|
||||||
let shareViewNavigationController: OWSNavigationController = OWSNavigationController()
|
private var shareViewNavigationController: OWSNavigationController?
|
||||||
|
|
||||||
override open func loadView() {
|
override open func loadView() {
|
||||||
super.loadView()
|
super.loadView()
|
||||||
|
@ -70,6 +70,9 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let shareViewNavigationController = OWSNavigationController()
|
||||||
|
self.shareViewNavigationController = shareViewNavigationController
|
||||||
|
|
||||||
let loadViewController = SAELoadViewController(delegate: self)
|
let loadViewController = SAELoadViewController(delegate: self)
|
||||||
self.loadViewController = loadViewController
|
self.loadViewController = loadViewController
|
||||||
|
|
||||||
|
@ -452,6 +455,10 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
||||||
// If user is registered, do nothing.
|
// If user is registered, do nothing.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
guard let shareViewNavigationController = shareViewNavigationController else {
|
||||||
|
owsFailDebug("Missing shareViewNavigationController")
|
||||||
|
return
|
||||||
|
}
|
||||||
guard let firstViewController = shareViewNavigationController.viewControllers.first else {
|
guard let firstViewController = shareViewNavigationController.viewControllers.first else {
|
||||||
// If no view has been presented yet, do nothing.
|
// If no view has been presented yet, do nothing.
|
||||||
return
|
return
|
||||||
|
@ -513,6 +520,10 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
||||||
private func showPrimaryViewController(_ viewController: UIViewController) {
|
private func showPrimaryViewController(_ viewController: UIViewController) {
|
||||||
AssertIsOnMainThread()
|
AssertIsOnMainThread()
|
||||||
|
|
||||||
|
guard let shareViewNavigationController = shareViewNavigationController else {
|
||||||
|
owsFailDebug("Missing shareViewNavigationController")
|
||||||
|
return
|
||||||
|
}
|
||||||
shareViewNavigationController.setViewControllers([viewController], animated: false)
|
shareViewNavigationController.setViewControllers([viewController], animated: false)
|
||||||
if self.presentedViewController == nil {
|
if self.presentedViewController == nil {
|
||||||
Logger.debug("presenting modally: \(viewController)")
|
Logger.debug("presenting modally: \(viewController)")
|
||||||
|
|
Loading…
Reference in a new issue