From dd7641c92e032222ead8a387fa15ecaaf6e06900 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 19 Dec 2024 13:32:19 +0100 Subject: [PATCH] chore: mark synched datalayers as "loaded" Otherwise, when they will get the "_referenceVersion" later, they will call the server to fetch the data (while they already have the data, from the sync itself) --- umap/static/umap/js/modules/sync/updaters.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/sync/updaters.js b/umap/static/umap/js/modules/sync/updaters.js index eafb51f2..75c4a9f2 100644 --- a/umap/static/umap/js/modules/sync/updaters.js +++ b/umap/static/umap/js/modules/sync/updaters.js @@ -54,7 +54,10 @@ export class MapUpdater extends BaseUpdater { export class DataLayerUpdater extends BaseUpdater { upsert({ value }) { // Upsert only happens when a new datalayer is created. - this._umap.createDataLayer(value, false) + const datalayer = this._umap.createDataLayer(value, false) + // Prevent the layer to get data from the server, as it will get it + // from the sync. + datalayer._loaded = true } update({ key, metadata, value }) {