From 047f0e075fbf36a6ab60ce929d5d2074340437d9 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 5 Sep 2020 02:51:10 +0200 Subject: [PATCH] Fixed that application crashes if we're in editing mode and last bank gets deleted --- ui/BankingiOSApp/BankingiOSApp/ui/views/SettingsDialog.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/SettingsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/SettingsDialog.swift index 7884adb7..24f926df 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/SettingsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/SettingsDialog.swift @@ -64,7 +64,10 @@ struct SettingsDialog: View { } func deleteAccount(_ bankToDelete: Customer) { - presenter.deleteAccount(customer: bankToDelete) + // don't know why but when deleting last bank application crashes if we don't delete bank async + DispatchQueue.main.async { + self.presenter.deleteAccount(customer: bankToDelete) + } } }