|
|
@ -13,6 +13,7 @@ export function syncEntriesToItemMap(
|
|
|
|
collection: EteSync.CollectionInfo, entries: List<EteSync.SyncEntry>, base: {[key: string]: ContactType} = {}) {
|
|
|
|
collection: EteSync.CollectionInfo, entries: List<EteSync.SyncEntry>, base: {[key: string]: ContactType} = {}) {
|
|
|
|
const items = base;
|
|
|
|
const items = base;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const errors: Error[] = [];
|
|
|
|
entries.forEach((syncEntry) => {
|
|
|
|
entries.forEach((syncEntry) => {
|
|
|
|
// FIXME: this is a terrible hack to handle parsing errors
|
|
|
|
// FIXME: this is a terrible hack to handle parsing errors
|
|
|
|
let comp;
|
|
|
|
let comp;
|
|
|
@ -20,7 +21,7 @@ export function syncEntriesToItemMap(
|
|
|
|
comp = ContactType.parse(syncEntry.content);
|
|
|
|
comp = ContactType.parse(syncEntry.content);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
e.message = `${e.message}\nWhile processing: ${syncEntry.content}`;
|
|
|
|
e.message = `${e.message}\nWhile processing: ${syncEntry.content}`;
|
|
|
|
store.dispatch(appendError(undefined as any, e));
|
|
|
|
errors.push(e);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -36,6 +37,10 @@ export function syncEntriesToItemMap(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (errors.length > 0) {
|
|
|
|
|
|
|
|
store.dispatch(appendError(undefined as any, errors));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return items;
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -87,6 +92,7 @@ function syncEntriesToCalendarItemMap<T extends EventType>(
|
|
|
|
|
|
|
|
|
|
|
|
const color = colorIntToHtml(collection.color);
|
|
|
|
const color = colorIntToHtml(collection.color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const errors: Error[] = [];
|
|
|
|
entries.forEach((syncEntry) => {
|
|
|
|
entries.forEach((syncEntry) => {
|
|
|
|
// FIXME: this is a terrible hack to handle parsing errors
|
|
|
|
// FIXME: this is a terrible hack to handle parsing errors
|
|
|
|
let comp;
|
|
|
|
let comp;
|
|
|
@ -94,7 +100,7 @@ function syncEntriesToCalendarItemMap<T extends EventType>(
|
|
|
|
comp = ItemType.parse(syncEntry.content);
|
|
|
|
comp = ItemType.parse(syncEntry.content);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
e.message = `${e.message}\nWhile processing: ${syncEntry.content}`;
|
|
|
|
e.message = `${e.message}\nWhile processing: ${syncEntry.content}`;
|
|
|
|
store.dispatch(appendError(undefined as any, e));
|
|
|
|
errors.push(e);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -116,6 +122,10 @@ function syncEntriesToCalendarItemMap<T extends EventType>(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (errors.length > 0) {
|
|
|
|
|
|
|
|
store.dispatch(appendError(undefined as any, errors));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return items;
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|