Skip to content

Commit

Permalink
fix(lambda-tiler): corrected conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tawera-manaena committed Oct 24, 2024
1 parent 8304f90 commit 0cb7768
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/attribution/src/attribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class Attribution {
const attribution = createLicensorAttribution(providers);
const list = this.renderList(filtered);

if (list.length) {
if (list.length > 0) {
return `${attribution} - ${list}`;
} else {
return attribution;
Expand Down
4 changes: 2 additions & 2 deletions packages/lambda-tiler/src/routes/attribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ export async function createTileSetAttribution(

// ensure imagery exist for the given projection
const imgId = tileSet.layers[0][projection.code];
if (imgId === undefined) return '';
if (imgId == null) return '';

// attempt to load the imagery
const imagery = await provider.Imagery.get(imgId);
if (imagery == null || imagery.providers == null) {
if (imagery?.providers == null) {
return createLicensorAttribution();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/landing/src/attribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class MapAttribution implements maplibre.IControl {
Config.map.emit('visibleLayers', filteredLayerIds);

const attributionHTML = attr.renderLicense(filtered);
this.setAttribution(attributionHTML ?? '');
this.setAttribution(attributionHTML);
};

setAttribution(text: string): void {
Expand Down

0 comments on commit 0cb7768

Please sign in to comment.