Skip to content

Commit

Permalink
🐛 In case of no relations, show user message and stop
Browse files Browse the repository at this point in the history
  • Loading branch information
volterra79 committed Dec 11, 2024
1 parent 96bbe9b commit b733b10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions toolboxes/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,17 @@ export class ToolBox extends G3WObject {
//Relations layer
const rLayer = getEditingLayerById(relationLayerId);

if (0 === rLayer.readFeatures().length) {
GUI.setModal(false);

GUI.showUserMessage({
type: 'warning',
message: 'plugins.editing.no_relations_found',
autoclose: true,
})
return $promisify(Promise.reject());
}

const fields = getRelationFieldsFromRelation({
layerId: relations[0].getChild(),
relation: relations[0]
Expand Down

0 comments on commit b733b10

Please sign in to comment.