Trak delete (again).

This commit is contained in:
Eric van der Vlist 2023-01-09 14:40:37 +01:00
parent 9931887f03
commit 1f3c1c750e
2 changed files with 12 additions and 3 deletions

View File

@ -17,6 +17,7 @@ const GpxViewer: Component<Props> = ({ gpxId, restrictToHierarchy }) => {
const title = () => { const title = () => {
return gpx().metadata.name; return gpx().metadata.name;
}; };
return ( return (
<Tree <Tree
title={ title={
@ -30,8 +31,12 @@ const GpxViewer: Component<Props> = ({ gpxId, restrictToHierarchy }) => {
content={undefined} content={undefined}
subTree={ subTree={
<For <For
each={Object.keys(restrictToHierarchy).filter((key: string) => each={Object.keys(restrictToHierarchy).filter(
key.startsWith('gpx/') (key: string) =>
key.startsWith('gpx/') &&
(gpx().trk?.includes(key) ||
gpx().wpt?.includes(key) ||
gpx().rte?.includes(key))
)} )}
> >
{(key: string) => { {(key: string) => {

View File

@ -1,4 +1,4 @@
import { Component, createSignal, For, Show } from 'solid-js'; import { Component, createEffect, createSignal, For, Show } from 'solid-js';
import { peekCachedSignal } from '../../workers/cached-signals'; import { peekCachedSignal } from '../../workers/cached-signals';
import Tree from '../tree'; import Tree from '../tree';
import TrkIcon from '../../icons/human-footprints-svgrepo-com.svg?component-solid'; import TrkIcon from '../../icons/human-footprints-svgrepo-com.svg?component-solid';
@ -48,6 +48,10 @@ const TrkViewer: Component<Props> = ({ trkId, restrictToHierarchy }) => {
setConfirmDelete(false); setConfirmDelete(false);
}; };
createEffect(() => {
console.log({ caller: 'TrkViewer / createEffect', trkId, trk: trk() });
});
return ( return (
<> <>
<Tree <Tree