Starting to add some style to trksegs.
This commit is contained in:
1 parent
bbaf1e798b
commit
12cfa9337a
4 files changed
+45
-16
No files matched your search
@@ -25,22 +25,30 @@ const GpxImport: Component = () => {
|
||||
console.log(fileReader.result);
|
||||
const gpx = GPX.parse(fileReader.result);
|
||||
console.log(`gpx: ${JSON.stringify(gpx)}`);
|
||||
const startTime = new Date(findStartTime(gpx)!);
|
||||
dispatch({
|
||||
action: 'pruneAndSaveImportedGpx',
|
||||
params: {
|
||||
id: { gpx: intToGpxId(startTime.valueOf()) },
|
||||
gpx: gpx,
|
||||
tech: {
|
||||
lastModified: new Date(file.lastModified).toISOString(),
|
||||
importDate: new Date().toISOString(),
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
type: file.type,
|
||||
if (gpx) {
|
||||
const startTime = new Date(findStartTime(gpx)!);
|
||||
dispatch({
|
||||
action: 'pruneAndSaveImportedGpx',
|
||||
params: {
|
||||
id: { gpx: intToGpxId(startTime.valueOf()) },
|
||||
gpx: gpx,
|
||||
tech: {
|
||||
lastModified: new Date(file.lastModified).toISOString(),
|
||||
importDate: new Date().toISOString(),
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
type: file.type,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
refetchGpxList();
|
||||
});
|
||||
refetchGpxList();
|
||||
} else {
|
||||
console.error({
|
||||
message: "can't parse GPX file",
|
||||
xml: fileReader.result,
|
||||
});
|
||||
}
|
||||
// TODO: error handling
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user