diff --git a/src/components/gpx-dialog/GpxDialog.tsx b/src/components/gpx-dialog/GpxDialog.tsx index 39a27ec..07a8f12 100644 --- a/src/components/gpx-dialog/GpxDialog.tsx +++ b/src/components/gpx-dialog/GpxDialog.tsx @@ -37,8 +37,8 @@ const GpxDialog: Component<{}> = (props) => { dispatch({ action: 'getCurrentAccount' }).then((currentAccount: any) => { console.log({ caller: 'GpxDialog / currentAccount', currentAccount }); setCurrentAccount(currentAccount); - setCurrentGpxId(currentAccount.currentGpxId); - setSelectedGpxId(currentAccount.currentGpxId); + setCurrentGpxId(currentAccount.currentGpxId || 'new'); + setSelectedGpxId(currentAccount.currentGpxId || 'new'); }); const handleClickOpen = async () => { diff --git a/src/components/import/ImportSingleFile.tsx b/src/components/import/ImportSingleFile.tsx index 308a223..3595c11 100644 --- a/src/components/import/ImportSingleFile.tsx +++ b/src/components/import/ImportSingleFile.tsx @@ -63,14 +63,19 @@ const ImportSingleFile: Component = ({ file: file }) => { const [statsAndGpx, setStatsAndGpx] = createSignal(); const [picture, setPicture] = createSignal(); const [state, setState] = createSignal('init'); - const [gpxId, setGpxId] = createSignal(''); + const [gpxId, setGpxId] = createSignal('new'); createEffect(() => { setGpxId(currentGpxId()); }); const parseGpx = (content: string) => { const gpx = GPX.parse(content); - console.log({ caller: 'ImportSingleFile / JSON', gpxFile: file, gpx }); + console.log({ + caller: 'ImportSingleFile / JSON', + gpxFile: file, + gpx, + gpxId: gpxId(), + }); setStatsAndGpx({ gpx, stats: analyzeGpx(gpx) }); };