Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronPlave committed Feb 22, 2024
1 parent d4e7864 commit cfdebd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/timeline/Row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
if (
resourceNames.indexOf(key) < 0 ||
value.simulationDatasetId !== simulationDatasetId ||
// TODO should we grab the store here or should we pass it down? Not seeing the value in making parent components
// re-render but maybe it's fine?
(value.type === 'external' && !$externalResourceNames.find(name => value.resource?.name === name))
) {
value.controller?.abort();
Expand Down Expand Up @@ -255,6 +257,7 @@
$: hasActivityLayer = !!layers.find(layer => layer.chartType === 'activity');
$: hasResourceLayer = !!layers.find(layer => layer.chartType === 'line' || layer.chartType === 'x-range');
// Track resource loading status for this Row
$: if (resourceRequestMap) {
const newLoadedResources: Resource[] = [];
const newLoadingErrors: string[] = [];
Expand All @@ -269,6 +272,8 @@
loadedResources = newLoadedResources;
loadingErrors = newLoadingErrors;
// Consider row to be loading if the number of completed resource requests (loaded or error state)
// is not equal to the total number of resource requests
anyResourcesLoading = loadedResources.length + loadingErrors.length !== Object.keys(resourceRequestMap).length;
}
Expand Down Expand Up @@ -409,6 +414,7 @@
}
}
// Retrieve resources from resourceRequestMap by a layer's resource filter
function getResourcesForLayer(layer: Layer, resourceRequestMap: Record<string, ResourceRequest> = {}) {
if (!layer.filter.resource) {
return [];
Expand Down

0 comments on commit cfdebd3

Please sign in to comment.