diff --git a/TalerWallet1/Views/Settings/BackupView.swift b/TalerWallet1/Views/Settings/BackupView.swift index 8a51e656..d20b7578 100644 --- a/TalerWallet1/Views/Settings/BackupView.swift +++ b/TalerWallet1/Views/Settings/BackupView.swift @@ -177,6 +177,20 @@ struct BackupView: View { withAnimation { selectedBackup = file } showRestoreAlert = true } + // a backup could be made and restored, but never removed from within the app + .swipeActions(edge: .trailing) { + Button(role: .destructive) { + if let docDirUrl = URL.docDirUrl { + try? FileManager.default.removeItem(at: docDirUrl.appendingPathComponent(file)) + } + if selectedBackup == file { selectedBackup = nil } + withAnimation { backups.removeAll { $0 == file } } + } label: { + Label("Delete", systemImage: "trash") + } + .tint(WalletColors().negative) + .accessibilityIdentifier("button.backup.delete") + } } } else { Text("No backups yet...")