From b9f562ab3f596cd9dff87b2f5902609aa841283f Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 20 Sep 2020 16:21:21 +0200 Subject: [PATCH] Extracted fetchAllTransactionsButton --- .../ui/dialogs/AccountTransactionsDialog.swift | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift index 87135f4f..d40b9c13 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift @@ -109,9 +109,7 @@ struct AccountTransactionsDialog: View { HStack { Spacer() - Button("Fetch all account transactions") { - self.fetchAllTransactions(self.accountsForWhichNotAllTransactionsHaveBeenFetched) - } + fetchAllTransactionsButton Spacer() } @@ -135,9 +133,7 @@ struct AccountTransactionsDialog: View { Spacer() - Button(action: { self.fetchAllTransactions(self.accountsForWhichNotAllTransactionsHaveBeenFetched) }) { - Text("Fetch all account transactions") - } + fetchAllTransactionsButton Spacer() } @@ -160,6 +156,13 @@ struct AccountTransactionsDialog: View { } + private var fetchAllTransactionsButton: some View { + Button("Fetch all account transactions") { + self.fetchAllTransactions(self.accountsForWhichNotAllTransactionsHaveBeenFetched) + } + } + + private func updateTransactions(_ executingDone: @escaping () -> Void) { presenter.updateSelectedBankAccountTransactionsAsync { response in executingDone()