From 3de323f9f6425d5bdb925160331f612b57a2eb7b Mon Sep 17 00:00:00 2001 From: Julian Gonggrijp Date: Thu, 20 May 2021 17:06:25 +0200 Subject: [PATCH] Cache the computed range in the Dropdown model (#455) --- frontend/src/semantic-search/dropdown-view.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/semantic-search/dropdown-view.ts b/frontend/src/semantic-search/dropdown-view.ts index 9b9a81ce..a0c854b4 100644 --- a/frontend/src/semantic-search/dropdown-view.ts +++ b/frontend/src/semantic-search/dropdown-view.ts @@ -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'),