diff --git a/src/components/gpx-chooser/GpxChooser.tsx b/src/components/gpx-chooser/GpxChooser.tsx index 2335021..55d23d3 100644 --- a/src/components/gpx-chooser/GpxChooser.tsx +++ b/src/components/gpx-chooser/GpxChooser.tsx @@ -23,6 +23,11 @@ const GpxChooser: Component = (props: Props) => { action: 'getAllGpxesWithSummary', }, (error, result) => { + console.log({ + caller: 'GpxChooser / getAllGpxesWithSummary', + error, + result, + }); if (!error) { setAllGpxes([ { id: 'new', name: t('newGpx'), creator: 'dyomedea' }, diff --git a/src/components/gpx-dialog/GpxDialog.tsx b/src/components/gpx-dialog/GpxDialog.tsx index 5ef8398..3384f13 100644 --- a/src/components/gpx-dialog/GpxDialog.tsx +++ b/src/components/gpx-dialog/GpxDialog.tsx @@ -24,7 +24,7 @@ const GpxDialog: Component<{}> = (props) => { console.log({ caller: 'GpxDialog', currentGpxId: currentGpxId() }); const fetchGpx = (gpxId: string) => { - if (gpxId === 'new') { + if (gpxId === 'new' || !gpxId) { return newEmptyGpx(); } const newGpx = peekCachedSignal({ @@ -43,9 +43,7 @@ const GpxDialog: Component<{}> = (props) => { const handleClickOpen = async () => { setOpen(true); - if (currentGpxId() !== '') { - setGpx(fetchGpx(currentGpxId()) as Gpx); - } + setGpx(fetchGpx(currentGpxId()) as Gpx); console.log({ caller: 'GpxDialog / handleClickOpen', currentGpxId: currentGpxId(), diff --git a/src/components/trk/Trk.tsx b/src/components/trk/Trk.tsx index 8786053..f09c2fc 100644 --- a/src/components/trk/Trk.tsx +++ b/src/components/trk/Trk.tsx @@ -1,17 +1,12 @@ import { Component, createEffect, - createResource, - createSignal, For, onCleanup, Suspense, } from 'solid-js'; -import OlMap from 'ol/Map'; -import dispatch, { cancelDispatch } from '../../workers/dispatcher-main'; -import getUri from '../../lib/ids'; import Trkseg from '../trkseg'; import VectorSource from 'ol/source/Vector'; diff --git a/src/db/gpx.ts b/src/db/gpx.ts index ebc7511..d214eae 100644 --- a/src/db/gpx.ts +++ b/src/db/gpx.ts @@ -421,7 +421,7 @@ export const putGpx = async (params: any) => { let { id, gpx } = params; try { - if (id === 'new') { + if (id === 'new' || !id) { const date = !!gpx.metadata.time ? new Date(gpx.metadata.time) : new Date();