summaryrefslogtreecommitdiff
path: root/Rune/Views/Domains/DomainDetailView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Rune/Views/Domains/DomainDetailView.swift')
-rw-r--r--Rune/Views/Domains/DomainDetailView.swift28
1 files changed, 25 insertions, 3 deletions
diff --git a/Rune/Views/Domains/DomainDetailView.swift b/Rune/Views/Domains/DomainDetailView.swift
index dbb90a1..b4ee00d 100644
--- a/Rune/Views/Domains/DomainDetailView.swift
+++ b/Rune/Views/Domains/DomainDetailView.swift
@@ -25,6 +25,12 @@ struct DomainDetailView: View {
DetailRow(label: "Nameservers", value: nameserverText(domain.nameservers))
}
+ Section("Email") {
+ NavigationLink("Forwards") {
+ ForwardListView(domainName: domain.name, viewModel: viewModel, client: client)
+ }
+ }
+
Section("DNS") {
NavigationLink("Records") {
RecordListView(domainName: domain.name, viewModel: viewModel, client: client)
@@ -49,7 +55,12 @@ struct DomainDetailView: View {
.alert("API Error", isPresented: errorBinding) {
Button("OK", role: .cancel) {}
} message: {
- Text(viewModel.errorMessage ?? "")
+ Text(viewModel.detailErrorMessage ?? "")
+ }
+ .alert("Request Failed", isPresented: mutationErrorBinding) {
+ Button("OK", role: .cancel) {}
+ } message: {
+ Text(viewModel.mutationErrorMessage ?? "")
}
}
@@ -88,10 +99,21 @@ struct DomainDetailView: View {
private var errorBinding: Binding<Bool> {
Binding(
- get: { viewModel.errorMessage != nil },
+ get: { viewModel.detailErrorMessage != nil },
+ set: { newValue in
+ if !newValue {
+ viewModel.detailErrorMessage = nil
+ }
+ }
+ )
+ }
+
+ private var mutationErrorBinding: Binding<Bool> {
+ Binding(
+ get: { viewModel.mutationErrorMessage != nil },
set: { newValue in
if !newValue {
- viewModel.errorMessage = nil
+ viewModel.dismissMutationError()
}
}
)