Merge branch 'main' into dev
This commit is contained in:
commit
4c17c3ddfe
1 changed files with 4 additions and 3 deletions
|
@ -269,9 +269,10 @@ export async function loadFile(file: File): Promise<GPXFile | null> {
|
||||||
if (data) {
|
if (data) {
|
||||||
let gpx = parseGPX(data);
|
let gpx = parseGPX(data);
|
||||||
if (gpx.metadata === undefined) {
|
if (gpx.metadata === undefined) {
|
||||||
gpx.metadata = { name: file.name.split('.').slice(0, -1).join('.') };
|
gpx.metadata = {};
|
||||||
} else if (gpx.metadata.name === undefined) {
|
}
|
||||||
gpx.metadata['name'] = file.name.split('.').slice(0, -1).join('.');
|
if (gpx.metadata.name === undefined || gpx.metadata.name.trim() === '') {
|
||||||
|
gpx.metadata.name = file.name.split('.').slice(0, -1).join('.');
|
||||||
}
|
}
|
||||||
resolve(gpx);
|
resolve(gpx);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue