|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import { Route, Redirect } from 'react-router';
|
|
|
|
|
|
|
|
|
|
import * as ICAL from 'ical.js';
|
|
|
|
|
|
|
|
|
|
import { EteSyncContextType } from './EteSyncContext';
|
|
|
|
|
import * as EteSync from './api/EteSync';
|
|
|
|
|
|
|
|
|
@ -56,8 +58,20 @@ export class JournalView extends React.Component {
|
|
|
|
|
let cryptoManager = new EteSync.CryptoManager(derived, journal.uid, journal.version);
|
|
|
|
|
let syncEntry = entry.getSyncEntry(cryptoManager, prevUid);
|
|
|
|
|
prevUid = entry.uid;
|
|
|
|
|
return (<li key={entry.uid}>{syncEntry.type}: {syncEntry.content}</li>);
|
|
|
|
|
});
|
|
|
|
|
const comp = new ICAL.Component(ICAL.parse(syncEntry.content));
|
|
|
|
|
|
|
|
|
|
if (comp.name === 'vcalendar') {
|
|
|
|
|
const vevent = new ICAL.Event(comp.getFirstSubcomponent('vevent'));
|
|
|
|
|
return (<li key={entry.uid}>{syncEntry.action}: {vevent.summary} ({vevent.uid})</li>);
|
|
|
|
|
} else if (comp.name === 'vcard') {
|
|
|
|
|
const vcard = comp;
|
|
|
|
|
const name = vcard.getFirstPropertyValue('fn');
|
|
|
|
|
const uid = vcard.getFirstPropertyValue('uid');
|
|
|
|
|
return (<li key={entry.uid}>{syncEntry.action}: {name} ({uid})</li>);
|
|
|
|
|
} else {
|
|
|
|
|
return (<li key={entry.uid}>{syncEntry.action}: {syncEntry.content}</li>);
|
|
|
|
|
}
|
|
|
|
|
}).reverse();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|