Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where email login does not appear to finish #6659

Merged
merged 2 commits into from
May 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions RustFxA/FirefoxAccountSignInViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class FirefoxAccountSignInViewController: UIViewController {
/// telemetryObject deduced from parentType initializer is sent with telemetry events on button click
private let telemetryObject: UnifiedTelemetry.EventObject

/// Dismissal style for FxAWebViewController
/// Changes based on whether or not this VC is launched from the app menu or settings
private let fxaDismissStyle: DismissType

// MARK: Init() and viewDidLoad()

/// - Parameters:
Expand All @@ -87,10 +91,13 @@ class FirefoxAccountSignInViewController: UIViewController {
switch parentType {
case .appMenu:
self.telemetryObject = .appMenu
self.fxaDismissStyle = .dismiss
case .onboarding:
self.telemetryObject = .onboarding
self.fxaDismissStyle = .dismiss
case .settings:
self.telemetryObject = .settings
self.fxaDismissStyle = .popToRootVC
}
super.init(nibName: nil, bundle: nil)
}
Expand Down Expand Up @@ -159,17 +166,17 @@ class FirefoxAccountSignInViewController: UIViewController {

/// Use email login button tapped
@objc func emailLoginTapped(_ sender: UIButton) {
let fxaWebVC = FxAWebViewController(pageType: .emailLoginFlow, profile: profile, dismissalStyle: .popToRootVC)
let fxaWebVC = FxAWebViewController(pageType: .emailLoginFlow, profile: profile, dismissalStyle: fxaDismissStyle)
UnifiedTelemetry.recordEvent(category: .firefoxAccount, method: .qrPairing, object: telemetryObject, extras: ["flow_type": "email"])
presentThemedViewController(navItemLocation: .Left, navItemText: .Close, vcBeingPresented: fxaWebVC, topTabsVisible: true)
navigationController?.pushViewController(fxaWebVC, animated: true)
}
}

// MARK: QRCodeViewControllerDelegate Functions
extension FirefoxAccountSignInViewController: QRCodeViewControllerDelegate {
func didScanQRCodeWithURL(_ url: URL) {
let vc = FxAWebViewController(pageType: .qrCode(url: url.absoluteString), profile: profile, dismissalStyle: .popToRootVC)
presentThemedViewController(navItemLocation: .Left, navItemText: .Close, vcBeingPresented: vc, topTabsVisible: true)
let vc = FxAWebViewController(pageType: .qrCode(url: url.absoluteString), profile: profile, dismissalStyle: fxaDismissStyle)
navigationController?.pushViewController(vc, animated: true)
}

func didScanQRCodeWithText(_ text: String) {
Expand Down