Add calendar event editing

This commit is contained in:
Jon Staab
2025-03-18 15:36:52 -07:00
parent 1d56a2193d
commit 33af39ee93
11 changed files with 291 additions and 200 deletions
+3 -1
View File
@@ -23,6 +23,7 @@ import {
matchFilters,
getTagValues,
getTagValue,
getAddress,
isShareableRelayUrl,
} from "@welshman/util"
import type {TrustedEvent, Filter, List} from "@welshman/util"
@@ -214,6 +215,7 @@ export const makeCalendarFeed = ({
const insertEvent = (event: TrustedEvent) => {
const start = getStart(event)
const address = getAddress(event)
if (isNaN(start) || isNaN(getEnd(event))) return
@@ -223,7 +225,7 @@ export const makeCalendarFeed = ({
if (getStart($events[i]) > start) return insert(i, event, $events)
}
return [...$events, event]
return [...$events.filter(e => getAddress(e) !== address), event]
})
}