Skip to content

Commit

Permalink
Checks the number of passes from renew service to fix a bug where cou…
Browse files Browse the repository at this point in the history
…ldn’t differentiate between renewed or already had latest pass
  • Loading branch information
kinoroy committed Mar 16, 2017
1 parent 650030a commit ff3f8a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions RenewPass/RenewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class RenewViewController: UIViewController, CAAnimationDelegate {
private var reachability:Reachability = Reachability()!
@IBOutlet weak var reloadButton: UIButton!
@IBOutlet weak var statusLabel: UILabel!
var numUpass:String?
var shouldContinueReloadAnimation:Bool = false

// MARK: - Life Cycle
Expand Down Expand Up @@ -106,7 +105,7 @@ class RenewViewController: UIViewController, CAAnimationDelegate {
@IBAction func renewButtonTouchUpInside(_ sender: Any) {
// Reset the reload button image
self.reloadButton.setImage(#imageLiteral(resourceName: "requestButton"), for: .normal)
numUpass = nil
renewService.numUpass = nil
reloadButton.isEnabled = false
shouldContinueReloadAnimation = true
reloadButton.rotate360Degrees(completionDelegate: self)
Expand Down Expand Up @@ -159,7 +158,7 @@ class RenewViewController: UIViewController, CAAnimationDelegate {
} else if currentURL.contains(renewService.school.authPageURLIdentifier) { // School authentication screen
try renewService.authenticate(school: getSchoolID(school: renewService.school.school))
} else if currentURL.contains("fs") { // post-auth Upass site
if numUpass == nil {
if renewService.numUpass == nil {
try renewService.checkUpass()
} else {
try renewService.verifyRenew()
Expand Down

0 comments on commit ff3f8a4

Please sign in to comment.