Audited .alerts

- Consistent verb usage
- Removes dismiss buttons if they are the only action (automatically added)
This commit is contained in:
Stuart Breckenridge
2022-12-22 08:48:17 +08:00
parent bb40169dda
commit 66f6d563f3
4 changed files with 6 additions and 18 deletions

View File

@@ -101,13 +101,9 @@ struct AddAccountListView: View {
}
}
.alert(Text("Error", comment: "Alert title: Error"),
isPresented: $viewModel.showAddAccountError.1, actions: {
Button {
//
} label: {
Text("Dismiss", comment: "Button title")
}
}, message: {
isPresented: $viewModel.showAddAccountError.1,
actions: { },
message: {
Text("\(viewModel.showAddAccountError.0?.localizedDescription ?? "Unknown Error")")
})
.dismissOnAccountAdd()

View File

@@ -22,12 +22,10 @@ struct EnableExtensionPointView: View {
Section { enableButton }
}
.alert(Text("Error", comment: "Alert title: Error"), isPresented: $extensionError.1, actions: {
Button(action: {}, label: { Text("Dismiss", comment: "Button title") })
}, message: {
Text(extensionError.0?.localizedDescription ?? "Unknown Error")
})
.alert(Text("Error", comment: "Alert title: Error"), isPresented: $viewModel.showExtensionError.1, actions: {
Button(action: {}, label: { Text("Dismiss", comment: "Button title") })
}, message: {
Text(viewModel.showExtensionError.0?.localizedDescription ?? "Unknown Error")
})

View File

@@ -39,7 +39,7 @@ struct ExtensionsManagementView: View {
Button(role: .destructive) {
ExtensionPointManager.shared.deactivateExtensionPoint(extensionToDeactivate!.value.extensionPointID)
} label: {
Text("Deactivate", comment: "Button: deactivate extension.")
Text("Deactivate Extension", comment: "Button: deactivate extension.")
}
Button(role: .cancel) {

View File

@@ -107,7 +107,7 @@ struct ArticleThemeManagerView: View {
} label: {
let exists = themeManager.themeExists(filename: showImportConfirmationAlert.0?.path ?? "")
if exists == true {
Text("Overwrite", comment: "Button title")
Text("Overwrite Theme", comment: "Button title")
} else {
Text("Import Theme", comment: "Button title")
}
@@ -139,13 +139,7 @@ struct ArticleThemeManagerView: View {
})
.alert(Text("Error", comment: "Alert title: Error"),
isPresented: $showImportErrorAlert.1,
actions: {
Button(role: .cancel) {
} label: {
Text("Dismiss", comment: "Button title")
}
}, message: {
actions: { }, message: {
Text("\(showImportErrorAlert.0?.localizedDescription ?? "")")
})
.onReceive(themeManager.objectWillChange) { _ in