fix waypoint default sym value

This commit is contained in:
vcoppe
2025-11-27 08:01:05 +01:00
parent 467cb2e589
commit 69b018022d
2 changed files with 13 additions and 7 deletions

View File

@@ -1495,12 +1495,18 @@ export class Waypoint {
this.attributes = waypoint.attributes; this.attributes = waypoint.attributes;
this.ele = waypoint.ele; this.ele = waypoint.ele;
this.time = waypoint.time; this.time = waypoint.time;
this.name = waypoint.name; this.name = waypoint.name === '' ? undefined : waypoint.name;
this.cmt = waypoint.cmt; this.cmt = waypoint.cmt === '' ? undefined : waypoint.cmt;
this.desc = waypoint.desc; this.desc = waypoint.desc === '' ? undefined : waypoint.desc;
this.link = waypoint.link; this.link =
this.sym = waypoint.sym; !waypoint.link ||
this.type = waypoint.type; !waypoint.link.attributes ||
!waypoint.link.attributes.href ||
waypoint.link.attributes.href === ''
? undefined
: waypoint.link;
this.sym = waypoint.sym === '' ? undefined : waypoint.sym;
this.type = waypoint.type === '' ? undefined : waypoint.type;
if (waypoint.hasOwnProperty('_data')) { if (waypoint.hasOwnProperty('_data')) {
this._data = waypoint._data; this._data = waypoint._data;
} }

View File

@@ -95,7 +95,7 @@
desc: description.length > 0 ? description : undefined, desc: description.length > 0 ? description : undefined,
cmt: description.length > 0 ? description : undefined, cmt: description.length > 0 ? description : undefined,
link: link.length > 0 ? { attributes: { href: link } } : undefined, link: link.length > 0 ? { attributes: { href: link } } : undefined,
sym: sym, sym: sym.length > 0 ? sym : undefined,
}, },
selectedWaypoint.wpt && selectedWaypoint.fileId selectedWaypoint.wpt && selectedWaypoint.fileId
? new ListWaypointItem(selectedWaypoint.fileId, selectedWaypoint.wpt._data.index) ? new ListWaypointItem(selectedWaypoint.fileId, selectedWaypoint.wpt._data.index)