Always displaying now transferMoneyAction, but disabling it if no accounts supporting transferring money are added

This commit is contained in:
dankito 2020-09-05 02:03:29 +02:00
parent de72722e4c
commit 0133787ee4
1 changed files with 3 additions and 3 deletions

View File

@ -86,9 +86,9 @@ class TabBarController : UITabBarController, UITabBarControllerDelegate {
private func showNewOptionsActionSheet() {
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
if data.hasAccountsThatSupportTransferringMoney {
alert.addAction(UIAlertAction(title: "Show transfer money dialog".localize(), style: .default, handler: { _ in self.showView(TransferMoneyDialog()) }))
}
let transferMoneyAction = UIAlertAction(title: "Show transfer money dialog".localize(), style: .default, handler: { _ in self.showView(TransferMoneyDialog()) })
transferMoneyAction.isEnabled = data.hasAccountsThatSupportTransferringMoney
alert.addAction(transferMoneyAction)
alert.addAction(UIAlertAction(title: "Add account".localize(), style: .default, handler: { _ in self.showView(AddAccountDialog()) } ))
alert.addAction(UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil))