Adjust code to work with es5 as a target.

master
Tom Hacohen 7 years ago
parent a6ad199023
commit 4f88ff6364

@ -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));
}
});
}
}

@ -9,7 +9,7 @@ import * as EteSync from './api/EteSync';
export function syncEntriesToItemMap(collection: EteSync.CollectionInfo, entries: List<EteSync.SyncEntry>) {
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;
}

@ -2,7 +2,7 @@
"compilerOptions": {
"outDir": "build/dist",
"module": "esnext",
"target": "es2015",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,

Loading…
Cancel
Save