finish reworking immer updates

This commit is contained in:
vcoppe
2024-07-04 16:25:13 +02:00
parent 8643abfafa
commit 76b41dc546
7 changed files with 96 additions and 116 deletions

View File

@@ -35,7 +35,6 @@
import { flyAndScale } from '$lib/utils';
import { onDestroy, onMount } from 'svelte';
import { TrackPoint } from 'gpx';
import { produce } from 'immer';
export let popup: mapboxgl.Popup;
export let popupElement: HTMLElement;

View File

@@ -413,7 +413,7 @@ export class RoutingControls {
if (file.trk.length === 0) {
let track = new Track();
track.replaceTrackPoints(0, 0, 0, [newPoint]);
file.replaceTracks(0, 0, [track])[0];
file.replaceTracks(0, 0, [track]);
} else if (file.trk[trackIndex].trkseg.length === 0) {
let segment = new TrackSegment();
segment.replaceTrackPoints(0, 0, [newPoint]);