Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SWE-12 disable payment buttons in given situations
- if the minimum payment due is $0, we disable the button to allow paying that amount
- if the current account balance is $0, we disable the button to allow paying that amount
  • Loading branch information
ahm11003 committed Apr 5, 2019
1 parent 5407b69 commit fff4ae0
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -60,6 +60,9 @@ class PayBillInterfaceController: WKInterfaceController {
let minimumFormatted = String(format: "$%.2f", valid.minPayDue)
minimumLabel.setText("Minimum Payment:\n\(minimumFormatted)")
payMinimumButton.setTitle("Pay \(minimumFormatted)")

payMinimumButton.setEnabled(valid.minPayDue > 0.0)
payBalanceButton.setEnabled(valid.curBalance > 0.0)
}
}
}

0 comments on commit fff4ae0

Please sign in to comment.