diff --git a/src/app/modules/background/schedule/schedule-sync.service.ts b/src/app/modules/background/schedule/schedule-sync.service.ts index 3a7e7693..9ddbf53b 100644 --- a/src/app/modules/background/schedule/schedule-sync.service.ts +++ b/src/app/modules/background/schedule/schedule-sync.service.ts @@ -38,6 +38,7 @@ import { CALENDAR_SYNC_ENABLED_KEY, CALENDAR_SYNC_SETTINGS_KEY, } from '../../settings/page/calendar-sync-settings-keys'; +import {filter} from 'rxjs/operators'; @Injectable() export class ScheduleSyncService implements OnDestroy { @@ -49,10 +50,12 @@ export class ScheduleSyncService implements OnDestroy { private durationFormatPipe: DurationPipe, private calendar: CalendarService, ) { - this.scheduleProvider.uuids$.subscribe(uuids => { - this.uuids = uuids; - void this.syncNativeCalendar(); - }); + this.scheduleProvider.uuids$ + .pipe(filter(uuids => uuids?.length > 0)) + .subscribe(uuids => { + this.uuids = uuids; + void this.syncNativeCalendar(); + }); } uuids: SCUuid[];