mirror of
https://github.com/neon443/NearFuture.git
synced 2026-03-11 06:49:12 +00:00
fix editing events
This commit is contained in:
@@ -222,6 +222,13 @@ class EventViewModel: ObservableObject, @unchecked Sendable {
|
||||
saveEvents() //sync with icloud
|
||||
}
|
||||
|
||||
func editEvent(_ editedEvent: Event) {
|
||||
if let index = events.firstIndex(where: { editedEvent.id == $0.id }) {
|
||||
self.events[index] = editedEvent
|
||||
saveEvents()
|
||||
}
|
||||
}
|
||||
|
||||
func completeEvent(_ event: inout Event) {
|
||||
withAnimation { event.complete.toggle() }
|
||||
let eventToModify = self.events.firstIndex() { currEvent in
|
||||
|
||||
Reference in New Issue
Block a user