mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-03-14 09:45:42 +00:00
dirty way to save auto accept settings on dismiss
This commit is contained in:
parent
3f8751abbe
commit
e7b19ee8aa
1 changed files with 12 additions and 13 deletions
|
@ -12,6 +12,7 @@ import SimpleXChat
|
|||
|
||||
struct UserAddressView: View {
|
||||
@Environment(\.dismiss) var dismiss: DismissAction
|
||||
@Environment(\.presentationMode) var presentationMode
|
||||
@EnvironmentObject private var chatModel: ChatModel
|
||||
@EnvironmentObject var theme: AppTheme
|
||||
@State var viaCreateLinkView = false
|
||||
|
@ -48,20 +49,18 @@ struct UserAddressView: View {
|
|||
userAddressScrollView()
|
||||
} else {
|
||||
userAddressScrollView()
|
||||
.modifier(BackButton(disabled: Binding.constant(false)) {
|
||||
if savedAAS == aas {
|
||||
dismiss()
|
||||
} else {
|
||||
keyboardVisible = false
|
||||
showSaveDialogue = true
|
||||
.onDisappear {
|
||||
if (savedAAS != aas) {
|
||||
AlertManager.shared.showAlert(
|
||||
Alert(
|
||||
title: Text("Save settings?"),
|
||||
primaryButton: .default(Text("Save auto-accept settings")) {
|
||||
saveAAS()
|
||||
},
|
||||
secondaryButton: .destructive(Text("Exit without saving"))
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
.confirmationDialog("Save settings?", isPresented: $showSaveDialogue) {
|
||||
Button("Save auto-accept settings") {
|
||||
saveAAS()
|
||||
dismiss()
|
||||
}
|
||||
Button("Exit without saving") { dismiss() }
|
||||
}
|
||||
}
|
||||
if progressIndicator {
|
||||
|
|
Loading…
Add table
Reference in a new issue