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)
This commit is contained in:
Yohan Boniface 2024-12-19 13:32:19 +01:00
parent 6caf4c3ed1
commit dd7641c92e

View file

@ -54,7 +54,10 @@ export class MapUpdater extends BaseUpdater {
export class DataLayerUpdater extends BaseUpdater { export class DataLayerUpdater extends BaseUpdater {
upsert({ value }) { upsert({ value }) {
// Upsert only happens when a new datalayer is created. // 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 }) { update({ key, metadata, value }) {