Filters one-time events to avoid duplicates
Ensures that one-time events exclude recurring events, preventing duplicate entries. This resolves an issue where recurring events were incorrectly included in the list of one-time events, leading to events being displayed multiple times.
This commit is contained in:
parent
0f0eae8800
commit
83a87b2da6
1 changed files with 2 additions and 2 deletions
|
|
@ -256,8 +256,8 @@ export class ScheduledEventService extends BaseService {
|
||||||
getTodaysEvents(userPubkey?: string): ScheduledEvent[] {
|
getTodaysEvents(userPubkey?: string): ScheduledEvent[] {
|
||||||
const today = new Date().toISOString().split('T')[0]
|
const today = new Date().toISOString().split('T')[0]
|
||||||
|
|
||||||
// Get one-time events for today
|
// Get one-time events for today (exclude recurring events to avoid duplicates)
|
||||||
const oneTimeEvents = this.getEventsForDate(today)
|
const oneTimeEvents = this.getEventsForDate(today).filter(event => !event.recurrence)
|
||||||
|
|
||||||
// Get all events and check for recurring events that occur today
|
// Get all events and check for recurring events that occur today
|
||||||
const allEvents = this.getScheduledEvents()
|
const allEvents = this.getScheduledEvents()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue