Change how multiple calendars are merged together.

master
Tom Hacohen 7 years ago
parent c945731d8a
commit 802b994a6f

@ -34,8 +34,8 @@ class Pim extends React.Component {
render() { render() {
const derived = this.props.etesync.encryptionKey; const derived = this.props.etesync.encryptionKey;
let syncEntriesCalendar: EteSync.SyncEntry[] = []; let syncEntriesCalendar = [];
let syncEntriesAddressBook: EteSync.SyncEntry[] = []; let syncEntriesAddressBook = [];
for (const journal of this.props.journals) { for (const journal of this.props.journals) {
const journalEntries = this.props.entries[journal.uid]; const journalEntries = this.props.entries[journal.uid];
const cryptoManager = new EteSync.CryptoManager(derived, journal.uid, journal.version); const cryptoManager = new EteSync.CryptoManager(derived, journal.uid, journal.version);
@ -61,15 +61,15 @@ class Pim extends React.Component {
}); });
if (collectionInfo.type === 'ADDRESS_BOOK') { if (collectionInfo.type === 'ADDRESS_BOOK') {
syncEntriesAddressBook = syncEntriesAddressBook.concat(syncEntries); syncEntriesAddressBook.push(syncEntriesToItemMap(syncEntries));
} else if (collectionInfo.type === 'CALENDAR') { } else if (collectionInfo.type === 'CALENDAR') {
syncEntriesCalendar = syncEntriesCalendar.concat(syncEntries); syncEntriesCalendar.push(syncEntriesToCalendarItemMap(syncEntries));
} }
} }
let addressBookItems = syncEntriesToItemMap(syncEntriesAddressBook); let addressBookItems = syncEntriesAddressBook.reduce((base, x) => Object.assign(base, x), {});
let calendarItems = syncEntriesToCalendarItemMap(syncEntriesCalendar); let calendarItems = syncEntriesCalendar.reduce((base, x) => Object.assign(base, x), {});
return ( return (
<Switch> <Switch>

Loading…
Cancel
Save