can now edit events, need to make it apply on the fly

added about window
This commit is contained in:
neon443 committed 2025-05-28 13:42:53 +01:00
1 parent 1179810ac2
commit 1902c5102c
9 files changed
+192 -28

No files matched your search

@@ -12,19 +12,6 @@ struct EditEventView: View {
@ObservedObject var viewModel: EventViewModel
@Binding var event: Event
fileprivate func saveEdits() {
//if there is an event in vM.events with the id of the event we r editing,
//firstindex - loops through the arr and finds first element where that events id matches editing event's id
if let index = viewModel.events.firstIndex(where: { xEvent in
xEvent.id == event.id
}) {
viewModel.events[index] = event
}
viewModel.saveEvents()
dismiss()
}
var body: some View {
AddEventView(
viewModel: viewModel,
@@ -42,7 +29,7 @@ struct EditEventView: View {
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button() {
saveEdits()
dismiss()
} label: {
Text("Done")
.bold()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.