File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
apps/desktop/src/services/apple-calendar Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ export interface Ctx {
77 userId : string ;
88 from : Date ;
99 to : Date ;
10- calendarIds : string [ ] ;
10+ calendarIds : Set < string > ;
1111}
1212
1313export function createCtx ( store : Store , queries : Queries < Schemas > ) : Ctx | null {
1414 const resultTable = queries . getResultTable ( QUERIES . enabledAppleCalendars ) ;
1515
16- const calendarIds = Object . keys ( resultTable ) ;
16+ const calendarIds = new Set ( Object . keys ( resultTable ) ) ;
1717
18- if ( calendarIds . length === 0 ) {
18+ if ( calendarIds . size === 0 ) {
1919 return null ;
2020 }
2121
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { Ctx } from "../ctx";
22import type { ExistingEvent } from "./types" ;
33
44export function fetchExistingEvents ( ctx : Ctx ) : Array < ExistingEvent > {
5- const enabledCalendarIds = new Set ( ctx . calendarIds ) ;
5+ const enabledCalendarIds = ctx . calendarIds ;
66 const events : Array < ExistingEvent > = [ ] ;
77
88 ctx . store . forEachRow ( "events" , ( rowId , _forEachCell ) => {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export async function fetchIncomingEvents(
1010 ctx : Ctx ,
1111) : Promise < Array < IncomingEvent > > {
1212 const results = await Promise . all (
13- ctx . calendarIds . map ( async ( calendarId ) => {
13+ Array . from ( ctx . calendarIds ) . map ( async ( calendarId ) => {
1414 const result = await appleCalendarCommands . listEvents ( {
1515 calendar_tracking_id : calendarId ,
1616 from : ctx . from . toISOString ( ) ,
You can’t perform that action at this time.
0 commit comments