Cosmetic bug in GPX import.
This commit is contained in:
parent
55164ef2a3
commit
cef7431012
|
@ -1,4 +1,4 @@
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep, isEmpty } from 'lodash';
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
import { $DEVCOMP } from 'solid-js';
|
import { $DEVCOMP } from 'solid-js';
|
||||||
import { Point, Rectangle } from '../components/map/types';
|
import { Point, Rectangle } from '../components/map/types';
|
||||||
|
@ -111,12 +111,15 @@ const prune = (
|
||||||
...extensions,
|
...extensions,
|
||||||
...subObjects[index].extensions,
|
...subObjects[index].extensions,
|
||||||
};
|
};
|
||||||
|
if (isEmpty(subObjects[index].extensions)) {
|
||||||
|
subObjects[index].extensions = undefined;
|
||||||
|
}
|
||||||
docs.push({
|
docs.push({
|
||||||
_id: getUri(key, subId),
|
_id: getUri(key, subId),
|
||||||
type: key,
|
type: key,
|
||||||
doc: subObjects[index],
|
doc: subObjects[index],
|
||||||
});
|
});
|
||||||
prune(subId, subObjects[index], previousGpx, extensions, docs);
|
prune(subId, subObjects[index], previousGpx, {}, docs);
|
||||||
}
|
}
|
||||||
object[key] = undefined;
|
object[key] = undefined;
|
||||||
} else prune(id, object[key], previousGpx, extensions, docs);
|
} else prune(id, object[key], previousGpx, extensions, docs);
|
||||||
|
|
Loading…
Reference in New Issue