From 1851405fcf4a93d4702ad8f4eac1d0c9d8110add Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Thu, 21 Nov 2024 15:48:11 +0100 Subject: [PATCH] Remove warning from cache attaching if the tile has already reference. --- src/tilecache.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/tilecache.js b/src/tilecache.js index 09d43113..87a1f0b7 100644 --- a/src/tilecache.js +++ b/src/tilecache.js @@ -450,12 +450,15 @@ this._type = type; } 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 { - $.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); + } } }