COVIDSafe code from version 1.14 (#27)

This commit is contained in:
COVIDSafe Support 2020-11-09 16:51:00 -08:00 committed by GitHub
parent 3ea83834f5
commit cf93ea43c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 370 additions and 141 deletions

View file

@ -80,14 +80,11 @@ class OTPViewController: UIViewController, RegistrationHandler {
let pinIssuesString = NSLocalizedString("ReceivePinIssue", comment: "Text for pin receive issues button")
let pinIssuesText = NSAttributedString(string: pinIssuesString, attributes: buttonAtt)
self.pinIssuesButton?.setAttributedTitle(pinIssuesText, for: .normal)
if reauthenticating {
stepCounterLabel.text = String.localizedStringWithFormat( "stepCounter".localizedString(), 2, 2)
} else {
stepCounterLabel.text = String.localizedStringWithFormat( "stepCounter".localizedString(),
3,
UserDefaults.standard.bool(forKey: "allowedPermissions") ? 3 : 4
)
}
stepCounterLabel.text = String.localizedStringWithFormat( "stepCounter".localizedString(),
3,
UserDefaults.standard.bool(forKey: "allowedPermissions") ? 3 : 4
)
}
override func viewWillAppear(_ animated: Bool) {
@ -245,6 +242,7 @@ class OTPViewController: UIViewController, RegistrationHandler {
let keychain = KeychainSwift()
keychain.set(tokenToStore, forKey: "JWT_TOKEN", withAccess: .accessibleAfterFirstUnlock)
UserDefaults.standard.set(true, forKey: "HasUpdatedKeychainAccess")
UserDefaults.standard.set(false, forKey: "ReauthenticationNeededKey")
result(.Success)
}
}
@ -271,7 +269,8 @@ class OTPViewController: UIViewController, RegistrationHandler {
}
case .Success:
if (self.reauthenticating) {
self.dismiss(animated: true, completion: nil)
viewController.performSegue(withIdentifier: "showSuccessFromOTPSegue", sender: self)
// self.dismiss(animated: true, completion: nil)
return
}
if !UserDefaults.standard.bool(forKey: "allowedPermissions") {
@ -285,5 +284,11 @@ class OTPViewController: UIViewController, RegistrationHandler {
}
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let successVC = segue.destination as? OnboardingStep2bViewController {
successVC.reauthenticating = true
}
}
}