Audited alerts and confirmation dialogs

This commit is contained in:
Stuart Breckenridge
2022-12-22 18:28:15 +08:00
parent 66f6d563f3
commit 345b580f85
5 changed files with 8 additions and 22 deletions

View File

@@ -107,17 +107,7 @@ struct AccountsManagementView: View {
Text("Cancel", comment: "Button title")
}
} message: {
switch viewModel.accountToDelete {
case .none:
Text("")
case .some(let account):
switch account.type {
case .feedly:
Text("Are you sure you want to remove this account? NetNewsWire will no longer be able to access articles and feeds unless the account is added again.", comment: "Alert message: remove Feedly account confirmation")
default:
Text("Are you sure you want to remove this account? This cannot be undone.", comment: "Alert message: remove account confirmation")
}
}
Text("This action cannot be undone.", comment: "Alert message: remove account confirmation")
}
}

View File

@@ -33,7 +33,7 @@ struct ExtensionsManagementView: View {
.sheet(isPresented: $showAddExtensionView) {
AddExtensionListView()
}
.alert(Text("Deactivate Extension", comment: "Alert title: confirm deactivate extension"),
.alert(Text("Are you sure you want to deactivate “\(extensionToDeactivate?.value.title ?? "")?", comment: "Alert title: confirm deactivate extension"),
isPresented: $showDeactivateAlert) {
Button(role: .destructive) {
@@ -49,7 +49,7 @@ struct ExtensionsManagementView: View {
}
} message: {
Text("Are you sure you want to deactivate the “\(extensionToDeactivate?.value.title ?? "")” extension?", comment: "Alert message: confirm deactivation of extension.")
Text("This action cannot be undone.", comment: "Alert message: confirmation that deactivation of extension cannot be undone.")
}
.onReceive(NotificationCenter.default.publisher(for: .ActiveExtensionPointsDidChange)) { _ in
availableExtensionPointTypes = ExtensionPointManager.shared.availableExtensionPointTypes.sorted(by: { $0.title < $1.title })

View File

@@ -83,7 +83,7 @@ struct ArticleThemeManagerView: View {
Text("Cancel", comment: "Button title")
}
}, message: {
Text("Are you sure you want to delete this theme? This action cannot be undone.", comment: "Alert message: confirm theme deletion")
Text("This action cannot be undone.", comment: "Alert message: confirm theme deletion")
})
.alert(Text("Import Theme", comment: "Alert title: confirm theme import"),
isPresented: $showImportConfirmationAlert.1,