mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-08 08:08:43 +01:00
Automatically dismiss the account detail view when the account is deleted.
This commit is contained in:
parent
c4f7090b9c
commit
ccaeeb8e6d
@ -12,6 +12,7 @@ import Account
|
|||||||
import RSWeb
|
import RSWeb
|
||||||
|
|
||||||
struct SettingsDetailAccountView : View {
|
struct SettingsDetailAccountView : View {
|
||||||
|
@Environment(\.presentationMode) var presentation
|
||||||
@ObservedObject var viewModel: ViewModel
|
@ObservedObject var viewModel: ViewModel
|
||||||
@State private var isFeedbinCredentialsPresented = false
|
@State private var isFeedbinCredentialsPresented = false
|
||||||
@State private var isDeleteAlertPresented = false
|
@State private var isDeleteAlertPresented = false
|
||||||
@ -55,7 +56,10 @@ struct SettingsDetailAccountView : View {
|
|||||||
}
|
}
|
||||||
.alert(isPresented: $isDeleteAlertPresented) {
|
.alert(isPresented: $isDeleteAlertPresented) {
|
||||||
Alert(title: Text("Are you sure you want to delete \"\(viewModel.nameForDisplay)\"?"),
|
Alert(title: Text("Are you sure you want to delete \"\(viewModel.nameForDisplay)\"?"),
|
||||||
primaryButton: Alert.Button.default(Text("Delete"), action: { self.viewModel.delete() }),
|
primaryButton: Alert.Button.default(Text("Delete"), action: {
|
||||||
|
self.viewModel.delete()
|
||||||
|
self.presentation.wrappedValue.dismiss()
|
||||||
|
}),
|
||||||
secondaryButton: Alert.Button.cancel())
|
secondaryButton: Alert.Button.cancel())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user