Compare commits
2 Commits
495245427b
...
f0137eb1e5
| Author | SHA1 | Date | |
|---|---|---|---|
| f0137eb1e5 | |||
| 237c6db863 |
@ -1745,7 +1745,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 146;
|
||||
CURRENT_PROJECT_VERSION = 147;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
@ -1772,7 +1772,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 146;
|
||||
CURRENT_PROJECT_VERSION = 147;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
|
||||
@ -14,6 +14,8 @@ struct EventsScreen: View {
|
||||
|
||||
@State var viewModel: EventsViewModel
|
||||
@State var selectedEvent: EventModel?
|
||||
@State var deleteConfirmationPresented: Bool = false
|
||||
@State var eventToDelete: EventModel?
|
||||
|
||||
init(viewModel: EventsViewModel) {
|
||||
self.viewModel = viewModel
|
||||
@ -58,6 +60,18 @@ struct EventsScreen: View {
|
||||
} message: { event in
|
||||
Text(viewModel.getConfirmMessge(from: event))
|
||||
}
|
||||
.confirmationDialog(eventToDelete?.address ?? "",
|
||||
isPresented: $deleteConfirmationPresented,
|
||||
titleVisibility: .visible) {
|
||||
|
||||
Button("Delete", role: .destructive) {
|
||||
if let eventToDelete {
|
||||
Task { await viewModel.deleteEvent(eventToDelete) }
|
||||
}
|
||||
}
|
||||
} message: {
|
||||
Text("Are you sure you want to delete this event?")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -131,7 +145,8 @@ struct EventsScreen: View {
|
||||
}
|
||||
|
||||
Button(role: .destructive) {
|
||||
Task { await viewModel.deleteEvent(event) }
|
||||
eventToDelete = event
|
||||
deleteConfirmationPresented = true
|
||||
} label: {
|
||||
Label(useLabels ? "Delete" : "", systemImage: "trash")
|
||||
}
|
||||
|
||||
@ -419,3 +419,5 @@
|
||||
"Open in Maps" = "Открыть на карте";
|
||||
|
||||
"Something went wrong" = "Что-то пошло не так";
|
||||
|
||||
"Are you sure you want to delete this event?" = "Вы уверены, что хотите удалить это событие?";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user