Cosmetic bug in GPX import.

This commit is contained in:
Eric van der Vlist 2022-12-23 16:30:24 +01:00
parent 55164ef2a3
commit cef7431012
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { cloneDeep } from 'lodash';
import { cloneDeep, isEmpty } from 'lodash';
import { PureComponent } from 'react';
import { $DEVCOMP } from 'solid-js';
import { Point, Rectangle } from '../components/map/types';
@ -111,12 +111,15 @@ const prune = (
...extensions,
...subObjects[index].extensions,
};
if (isEmpty(subObjects[index].extensions)) {
subObjects[index].extensions = undefined;
}
docs.push({
_id: getUri(key, subId),
type: key,
doc: subObjects[index],
});
prune(subId, subObjects[index], previousGpx, extensions, docs);
prune(subId, subObjects[index], previousGpx, {}, docs);
}
object[key] = undefined;
} else prune(id, object[key], previousGpx, extensions, docs);