mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add the same unsaved changes alerts that Android has. (#4803)
* Add an alert to Discard or Save when there are unsaved changes on the RoomDetailsEditScreen. * Add an alert to Discard or Save when there are unsaved changes on the UserDetailsEditScreen. * Add an alert to Discard or Save when there are unsaved changes on the SecurityAndPrivacyScreen. * Update strings.
This commit is contained in:
@@ -39,6 +39,7 @@ struct SecurityAndPrivacyScreen: View {
|
||||
.compoundList()
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationTitle(L10n.screenSecurityAndPrivacyTitle)
|
||||
.navigationBarBackButtonHidden(!context.viewState.isSaveDisabled)
|
||||
.toolbar { toolbar }
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
@@ -185,6 +186,14 @@ struct SecurityAndPrivacyScreen: View {
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
if !context.viewState.isSaveDisabled {
|
||||
Button(L10n.actionCancel) {
|
||||
context.send(viewAction: .cancel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(L10n.actionSave) {
|
||||
context.send(viewAction: .save)
|
||||
|
||||
Reference in New Issue
Block a user