mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +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 {
|
struct UserAddressView: View {
|
||||||
@Environment(\.dismiss) var dismiss: DismissAction
|
@Environment(\.dismiss) var dismiss: DismissAction
|
||||||
|
@Environment(\.presentationMode) var presentationMode
|
||||||
@EnvironmentObject private var chatModel: ChatModel
|
@EnvironmentObject private var chatModel: ChatModel
|
||||||
@EnvironmentObject var theme: AppTheme
|
@EnvironmentObject var theme: AppTheme
|
||||||
@State var viaCreateLinkView = false
|
@State var viaCreateLinkView = false
|
||||||
|
@ -48,20 +49,18 @@ struct UserAddressView: View {
|
||||||
userAddressScrollView()
|
userAddressScrollView()
|
||||||
} else {
|
} else {
|
||||||
userAddressScrollView()
|
userAddressScrollView()
|
||||||
.modifier(BackButton(disabled: Binding.constant(false)) {
|
.onDisappear {
|
||||||
if savedAAS == aas {
|
if (savedAAS != aas) {
|
||||||
dismiss()
|
AlertManager.shared.showAlert(
|
||||||
} else {
|
Alert(
|
||||||
keyboardVisible = false
|
title: Text("Save settings?"),
|
||||||
showSaveDialogue = true
|
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 {
|
if progressIndicator {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue