Skip to content

Commit

Permalink
Fix: sonar cloud quick fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TIL-EBP committed Nov 26, 2024
1 parent 1e56a17 commit 43046b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 2 additions & 3 deletions ui/src/elements/ngm-layer-legend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ export class NgmLayerLegend extends LitElementI18n {

getImageLegend() {
const legendImage = this.config.legend ? `https://api.geo.admin.ch/static/images/legends/${this.config.legend}_${i18next.language}.png` : undefined;
return legendImage ? html`
return legendImage && html`
<div class="ngm-legend-container">
<div>${i18next.t('dtd_legend')}</div>
<div class="ngm-legend-image"><img src="${legendImage}"></div>
</div>
` : null;
</div>`;
}

async getWmtsLegend() {
Expand Down
9 changes: 2 additions & 7 deletions ui/src/elements/ngm-object-information.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ export class NgmObjectInformation extends LitElementI18n {
this.hidden = !this.opened;

QueryStore.objectInfo.subscribe(info => {
if (info) {
this.info = info;
this.opened = true;
} else if (this.opened) {
this.opened = false;
this.info = undefined;
}
this.info = info;
this.opened = info == null;

Check failure on line 26 in ui/src/elements/ngm-object-information.ts

View workflow job for this annotation

GitHub Actions / Lint UI

Expected '===' and instead saw '=='
});

document.addEventListener('keydown', (event) => {
Expand Down

0 comments on commit 43046b4

Please sign in to comment.