Enables recurring scheduled event completion

Extends scheduled event completion to support recurring events.

The changes introduce the concept of an "occurrence" for recurring events,
allowing users to mark individual instances of a recurring event as complete.
This involves:
- Adding recurrence information to the ScheduledEvent model.
- Modifying completion logic to handle recurring events with daily/weekly frequencies
- Updating UI to display recurrence information and mark individual occurrences as complete.
This commit is contained in:
padreug 2025-10-22 00:16:47 +02:00
parent f8802a6304
commit 6c432b45be
4 changed files with 147 additions and 46 deletions

View file

@ -200,10 +200,10 @@ async function onToggleLike(note: FeedPost) {
}
// Handle scheduled event completion toggle
async function onToggleComplete(event: ScheduledEvent) {
console.log('🎯 NostrFeed: onToggleComplete called for event:', event.title)
async function onToggleComplete(event: ScheduledEvent, occurrence?: string) {
console.log('🎯 NostrFeed: onToggleComplete called for event:', event.title, 'occurrence:', occurrence)
try {
await toggleComplete(event)
await toggleComplete(event, occurrence)
console.log('✅ NostrFeed: toggleComplete succeeded')
} catch (error) {
console.error('❌ NostrFeed: Failed to toggle event completion:', error)