From fb3bf98f1923db4bbba02728d23360a12319a08c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 1 Oct 2024 23:46:04 +0200 Subject: [PATCH] Fix: fix download panel --- src/Models/ThemeViewState.ts | 7 ++++++- src/UI/DownloadFlow/DownloadPanel.svelte | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Models/ThemeViewState.ts b/src/Models/ThemeViewState.ts index 7a7ea4f50..03c0c2261 100644 --- a/src/Models/ThemeViewState.ts +++ b/src/Models/ThemeViewState.ts @@ -155,6 +155,10 @@ export default class ThemeViewState implements SpecialVisualizationState { public readonly geocodedImages: UIEventSource = new UIEventSource([]) public readonly searchState: SearchState + /** + * Used to check in the download panel if used + */ + public readonly featureSummary: SummaryTileSourceRewriter constructor(layout: LayoutConfig, mvtAvailableLayers: Set) { Utils.initDomPurify() @@ -356,6 +360,7 @@ export default class ThemeViewState implements SpecialVisualizationState { bounds: this.visualFeedbackViewportBounds, }, ) + this.featureSummary = this.setupSummaryLayer() this.hasDataInView = new NoElementsInViewDetector(this).hasFeatureInView this.imageUploadManager = new ImageUploadManager( layout, @@ -785,7 +790,7 @@ export default class ThemeViewState implements SpecialVisualizationState { ), current_view: this.currentView, favourite: this.favourites, - summary: this.setupSummaryLayer(), + summary: this.featureSummary, last_click: this.lastClickObject, search: this.searchState.locationResults, } diff --git a/src/UI/DownloadFlow/DownloadPanel.svelte b/src/UI/DownloadFlow/DownloadPanel.svelte index 428eae6c7..0be2d6d48 100644 --- a/src/UI/DownloadFlow/DownloadPanel.svelte +++ b/src/UI/DownloadFlow/DownloadPanel.svelte @@ -22,7 +22,7 @@ let metaIsIncluded = false - let numberOfFeatures = state.featureSummary.totalNumberOfFeatures + let numberOfFeatures = state.featureSummary?.totalNumberOfFeatures async function getGeojson() { await state.indexedFeatures.downloadAll()