Skip to content

Commit

Permalink
Cache the computed range in the Dropdown model (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed May 20, 2021
1 parent a6cbd8e commit 3de323f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/semantic-search/dropdown-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export default class Dropdown extends CompositeView {
model: groupLabels.get('logic'),
collection: logic,
});
let range: Graph | Node = await normalizeRange(this.model);
let range: Graph | Node = this.model.get('range') as Graph;
if (!range) {
range = await normalizeRange(this.model);
this.model.set('range', range);
}
if (range.length > 1) {
this.typeGroup = new OptionGroup({
model: groupLabels.get('type'),
Expand Down

0 comments on commit 3de323f

Please sign in to comment.