Remove warning from cache attaching if the tile has already reference.

This commit is contained in:
Aiosa 2024-11-21 15:48:11 +01:00
parent 0bc7deccd7
commit 1851405fcf

View File

@ -450,12 +450,15 @@
this._type = type; this._type = type;
} }
this._tiles.push(tile); this._tiles.push(tile);
} else if (!this._tiles.includes(tile) && this.type && this._promise) {
// here really check we are loaded, since if optimization allows sending no data and we add tile without
// proper initialization it is a bug
this._tiles.push(tile);
} else { } else {
$.console.warn("Tile %s caching attempt without data argument on uninitialized cache entry!", tile); const tileExists = this._tiles.includes(tile);
if (!tileExists && this.type && this._promise) {
// here really check we are loaded, since if optimization allows sending no data and we add tile without
// proper initialization it is a bug
this._tiles.push(tile);
} else if (!tileExists) {
$.console.warn("Tile %s caching attempt without data argument on uninitialized cache entry!", tile);
}
} }
} }