Skip to content

Commit

Permalink
Merge pull request #1867 from rafavalpa/remove-dataviewconfig-without…
Browse files Browse the repository at this point in the history
…-data

Remove dataviewconfig without data
  • Loading branch information
ivmartel authored Feb 18, 2025
2 parents 41130e9 + 283a6a6 commit e989d89
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,9 @@ export class App {
delete configs[dataId];
}

const lg = this.#stage.getLayerGroupByDivId(divId);
// data is loaded, remove view
if (typeof this.#dataController.get(dataId) !== 'undefined') {
const lg = this.#stage.getLayerGroupByDivId(divId);
if (typeof lg !== 'undefined') {
const vls = lg.getViewLayersByDataId(dataId);
if (vls.length === 1) {
Expand All @@ -1055,11 +1055,12 @@ export class App {
if (vls.length === 0 && dls.length === 0) {
throw new Error('Expected one layer, got none');
}
if (lg.getNumberOfLayers() === 0) {
this.#stage.removeLayerGroup(lg);
}

}
}
if (lg.getNumberOfLayers() === 0) {
this.#stage.removeLayerGroup(lg);
}
}

/**
Expand Down

0 comments on commit e989d89

Please sign in to comment.