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

Loading…
Cancel
Save