Adding <Suspense> wrappers to start rendering Gpxes before they have all been fetched and removed auto compaction and compact db at init time.
This commit is contained in:
1 parent
079a36c1de
commit
3e191dbf38
4 files changed
+44
-10
No files matched your search
@@ -1,4 +1,10 @@
|
||||
import { Component, createEffect, createResource, For } from 'solid-js';
|
||||
import {
|
||||
Component,
|
||||
createEffect,
|
||||
createResource,
|
||||
For,
|
||||
Suspense,
|
||||
} from 'solid-js';
|
||||
|
||||
import OlMap from 'ol/Map';
|
||||
|
||||
@@ -27,7 +33,11 @@ export const AllGpxes: Component<Props> = ({ map }) => {
|
||||
<For each={allGpxIds()}>
|
||||
{(gpxId: string) => {
|
||||
console.log({ caller: 'AllGpxes / loop', gpxId });
|
||||
return <Gpx map={map} gpxId={gpxId} />;
|
||||
return (
|
||||
<Suspense>
|
||||
<Gpx map={map} gpxId={gpxId} />
|
||||
</Suspense>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { Component, createEffect, createResource, For } from 'solid-js';
|
||||
import {
|
||||
Component,
|
||||
createEffect,
|
||||
createResource,
|
||||
For,
|
||||
Suspense,
|
||||
} from 'solid-js';
|
||||
|
||||
import OlMap from 'ol/Map';
|
||||
|
||||
@@ -41,13 +47,21 @@ export const Gpx: Component<Props> = ({ map, gpxId }) => {
|
||||
<For each={gpx() ? gpx().trk || [] : []}>
|
||||
{(trkId: string) => {
|
||||
console.log({ caller: 'Gpx / loop', trkId });
|
||||
return <Trk vectorSource={vectorSource} trkId={trkId} />;
|
||||
return (
|
||||
<Suspense>
|
||||
<Trk vectorSource={vectorSource} trkId={trkId} />
|
||||
</Suspense>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
<For each={gpx() ? gpx().wpt || [] : []}>
|
||||
{(wptId: string) => {
|
||||
console.log({ caller: 'Gpx / loop', wptId });
|
||||
return <Wpt vectorSource={vectorSource} wptId={wptId} />;
|
||||
return (
|
||||
<Suspense>
|
||||
<Wpt vectorSource={vectorSource} wptId={wptId} />
|
||||
</Suspense>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { Component, createEffect, createResource, For } from 'solid-js';
|
||||
import {
|
||||
Component,
|
||||
createEffect,
|
||||
createResource,
|
||||
For,
|
||||
Suspense,
|
||||
} from 'solid-js';
|
||||
|
||||
import OlMap from 'ol/Map';
|
||||
|
||||
@@ -33,7 +39,11 @@ export const Trk: Component<Props> = ({ vectorSource, trkId }) => {
|
||||
<For each={trk() ? trk().trkseg || [] : []}>
|
||||
{(trksegId: string) => {
|
||||
console.log({ caller: 'Trk / loop', trksegId });
|
||||
return <Trkseg vectorSource={vectorSource} trksegId={trksegId} />;
|
||||
return (
|
||||
<Suspense>
|
||||
<Trkseg vectorSource={vectorSource} trksegId={trksegId} />
|
||||
</Suspense>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user