ImportDialog: adjust to the changes in the previous commit.

master
Tom Hacohen 5 years ago
parent d1b3d82024
commit 52d4ad9967

@ -154,11 +154,8 @@ class ImportDialog extends React.Component<PropsType> {
private onFileDropEvent(acceptedFiles: File[], rejectedFiles: File[]) { private onFileDropEvent(acceptedFiles: File[], rejectedFiles: File[]) {
const itemsCreator = (fileText: string) => { const itemsCreator = (fileText: string) => {
const calendarComp = new ICAL.Component(ICAL.parse(fileText)); const calendarComp = new ICAL.Component(ICAL.parse(fileText));
const timezoneComp = calendarComp.getFirstSubcomponent('vtimezone');
return calendarComp.getAllSubcomponents('vevent').map((comp) => { return calendarComp.getAllSubcomponents('vevent').map((comp) => {
const ret = new EventType(comp); return new EventType(comp);
ret.timezoneComp = timezoneComp;
return ret;
}); });
}; };
@ -168,11 +165,8 @@ class ImportDialog extends React.Component<PropsType> {
private onFileDropTask(acceptedFiles: File[], rejectedFiles: File[]) { private onFileDropTask(acceptedFiles: File[], rejectedFiles: File[]) {
const itemsCreator = (fileText: string) => { const itemsCreator = (fileText: string) => {
const calendarComp = new ICAL.Component(ICAL.parse(fileText)); const calendarComp = new ICAL.Component(ICAL.parse(fileText));
const timezoneComp = calendarComp.getFirstSubcomponent('vtimezone');
return calendarComp.getAllSubcomponents('vtodo').map((comp) => { return calendarComp.getAllSubcomponents('vtodo').map((comp) => {
const ret = new TaskType(comp); return new TaskType(comp);
ret.timezoneComp = timezoneComp;
return ret;
}); });
}; };

Loading…
Cancel
Save