diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx index 6bf6e84..22fea80 100644 --- a/src/SyncGate.tsx +++ b/src/SyncGate.tsx @@ -33,7 +33,7 @@ class SyncGate extends React.PureComponent { componentWillReceiveProps(nextProps: PropsTypeInner) { if (nextProps.journals.value && (this.props.journals.value !== nextProps.journals.value)) { - for (const journal of nextProps.journals.value) { + nextProps.journals.value.forEach((journal) => { let prevUid: string | null = null; const entries = this.props.entries.get(journal.uid); if (entries && entries.value) { @@ -42,7 +42,7 @@ class SyncGate extends React.PureComponent { } store.dispatch(fetchEntries(this.props.etesync, journal.uid, prevUid)); - } + }); } } diff --git a/src/journal-processors.tsx b/src/journal-processors.tsx index 3b3d6a9..6ffa2a5 100644 --- a/src/journal-processors.tsx +++ b/src/journal-processors.tsx @@ -9,7 +9,7 @@ import * as EteSync from './api/EteSync'; export function syncEntriesToItemMap(collection: EteSync.CollectionInfo, entries: List) { let items: {[key: string]: ContactType} = {}; - for (const syncEntry of entries) { + entries.forEach((syncEntry) => { let comp = new ContactType(new ICAL.Component(ICAL.parse(syncEntry.content))); const uid = comp.uid; @@ -23,7 +23,7 @@ export function syncEntriesToItemMap(collection: EteSync.CollectionInfo, entries } else if (syncEntry.action === EteSync.SyncEntryAction.Delete) { delete items[uid]; } - } + }); return items; } @@ -54,11 +54,11 @@ export function syncEntriesToCalendarItemMap(collection: EteSync.CollectionInfo, const color = colorIntToHtml(collection.color); - for (const syncEntry of entries) { + entries.forEach((syncEntry) => { let comp = EventType.fromVCalendar(new ICAL.Component(ICAL.parse(syncEntry.content))); if (comp === null) { - continue; + return; } comp.color = color; @@ -74,7 +74,7 @@ export function syncEntriesToCalendarItemMap(collection: EteSync.CollectionInfo, } else if (syncEntry.action === EteSync.SyncEntryAction.Delete) { delete items[uid]; } - } + }); return items; } diff --git a/tsconfig.json b/tsconfig.json index cd129d8..8597354 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "outDir": "build/dist", "module": "esnext", - "target": "es2015", + "target": "es5", "lib": ["es6", "dom"], "sourceMap": true, "allowJs": true,