Commit 2e44fefd authored by Jose Blaya's avatar Jose Blaya
Browse files

Fix flow for Purchase plan from expiring account

parent 6d4151da
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "group104Copy.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ internal enum Asset {
internal static let centeredLightMap = ImageAsset(name: "centered-light-map")
internal static let iconBack = ImageAsset(name: "icon-back")
internal static let iconCamera = ImageAsset(name: "icon-camera")
internal static let iconClose = ImageAsset(name: "icon-close")
internal static let iconWarning = ImageAsset(name: "icon-warning")
internal static let logoDark = ImageAsset(name: "logo-dark")
internal static let logoLight = ImageAsset(name: "logo-light")
......
......@@ -65,8 +65,6 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
}
vc.delegate = delegate
let navigationController = UINavigationController(rootViewController: vc)
navigationController.setNavigationBarHidden(false,
animated: false)
return navigationController
}
return UIViewController()
......
......@@ -56,8 +56,7 @@ public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompleti
fatalError("You are already logged in, you might want to Client.database.truncate() to start clean")
}
buttonCancel.isHidden = !preset.allowsCancel
buttonCancel.accessibilityLabel = L10n.Ui.Global.cancel
buttonCancel.isHidden = true
buttonEnvironment.isHidden = !accessedConfiguration.isDevelopment
#if os(iOS)
......@@ -70,14 +69,26 @@ public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompleti
/// :nodoc:
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(false, animated: true)
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
image: Theme.current.palette.navigationBarBackIcon?.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(back(_:))
)
self.navigationItem.leftBarButtonItem?.accessibilityLabel = L10n.Welcome.Redeem.Accessibility.back
if !preset.openFromDashboard {
self.navigationController?.setNavigationBarHidden(false, animated: true)
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
image: Theme.current.palette.navigationBarBackIcon?.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(back(_:))
)
self.navigationItem.leftBarButtonItem?.accessibilityLabel = L10n.Welcome.Redeem.Accessibility.back
} else {
if preset.allowsCancel {
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
image: Asset.iconClose.image.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(cancelClicked(_:))
)
self.navigationItem.leftBarButtonItem?.accessibilityLabel = L10n.Ui.Global.cancel
}
}
refreshEnvironmentButton()
}
......@@ -94,7 +105,7 @@ public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompleti
self.navigationController?.popViewController(animated: true)
}
@IBAction private func cancelClicked(_ sender: Any?) {
@objc private func cancelClicked(_ sender: Any?) {
delegate?.welcomeControllerDidCancel(self)
}
......
......@@ -42,6 +42,9 @@ public struct Preset: ProvidersAccess {
return (isEphemeral ? EphemeralAccountProvider() : accessedProviders.accountProvider)
}
/// If `true`, the view controller is opened from Dashboard.
public var openFromDashboard = false
/// Default initializer.
public init() {
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment