diff --git a/SignalShareExtension/SAELoadViewController.swift b/SignalShareExtension/SAELoadViewController.swift index c92939488..07d9e0f7d 100644 --- a/SignalShareExtension/SAELoadViewController.swift +++ b/SignalShareExtension/SAELoadViewController.swift @@ -9,7 +9,6 @@ import PureLayout // All Observer methods will be invoked from the main thread. protocol SAELoadViewDelegate: class { func shareExtensionWasCancelled() - func shareExtensionIsReady() } class SAELoadViewController: UIViewController { @@ -66,14 +65,6 @@ class SAELoadViewController: UIViewController { activityIndicator.startAnimating() } - override func viewDidAppear(_ animated: Bool) { - // FIXME not until ready, and ideally before view appears to avoid any "loading flicker" - DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) { - Logger.error("Simulating readiness...") - self.delegate?.shareExtensionIsReady() - } - } - override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) diff --git a/SignalShareExtension/ShareViewController.swift b/SignalShareExtension/ShareViewController.swift index 58d7c7996..b7c2f2ae0 100644 --- a/SignalShareExtension/ShareViewController.swift +++ b/SignalShareExtension/ShareViewController.swift @@ -227,6 +227,8 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S // SignalsNavigationController *navigationController = // [[SignalsNavigationController alloc] initWithRootViewController:homeView]; // self.window.rootViewController = navigationController; + + presentConversationPicker() } else { showNotRegisteredView() } @@ -349,18 +351,14 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil) } - public func shareExtensionIsReady() { - self.presentConversationPicker() - } - // MARK: Helpers private func presentConversationPicker() { let conversationPicker = SendExternalFileViewController() buildAttachment().then { attachment -> Void in conversationPicker.attachment = attachment - self.pushViewController(conversationPicker, animated: false) - Logger.info("presented conversation picker with attachment") + self.pushViewController(conversationPicker, animated: true) + Logger.info("presented conversation picker with attachment: \(attachment)") }.catch { error in OWSAlerts.showAlert(withTitle: NSLocalizedString("SHARE_EXTENSION_UNABLE_TO_BUILD_ATTACHMENT_ALERT_TITLE", comment: "Shown when trying to share content to a Signal user for the share extension. Followed by failure details."), message: error.localizedDescription,