From 3da77698e6aa0df4b7e4f3e3e685a1c3cf8a71a8 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Sun, 27 Jul 2025 13:17:47 +0200 Subject: [PATCH 1/2] fix --- src/dashboard/Data/Browser/Browser.react.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 829e4849e..4c5601817 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -982,17 +982,27 @@ class Browser extends DashboardView { } async handleFetchedSchema() { - const counts = this.state.counts; if (this.state.computingClassCounts === false) { this.setState({ computingClassCounts: true }); + + const promises = []; for (const parseClass of this.props.schema.data.get('classes')) { const [className] = parseClass; - counts[className] = await this.context.getClassCount(className); + const promise = this.context.getClassCount(className).then(count => { + this.setState(prevState => ({ + counts: { + ...prevState.counts, + [className]: count + } + })); + }); + promises.push(promise); } + + await Promise.all(promises); this.setState({ clp: this.props.schema.data.get('CLPs').toJS(), - counts, computingClassCounts: false, }); } @@ -2192,7 +2202,8 @@ class Browser extends DashboardView { classes.forEach((value, key) => { let count = this.state.counts[key]; if (count === undefined) { - count = ''; + // Show loading indicator while counts are being computed, empty string if computation is done + count = this.state.computingClassCounts ? '...' : ''; } else if (count >= 1000) { count = prettyNumber(count); } From e5d10145ebad36461032698fef9e6ee2bd6aff81 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Sun, 27 Jul 2025 13:18:37 +0200 Subject: [PATCH 2/2] lint --- src/dashboard/Data/Browser/Browser.react.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 4c5601817..014473bc2 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -984,7 +984,7 @@ class Browser extends DashboardView { async handleFetchedSchema() { if (this.state.computingClassCounts === false) { this.setState({ computingClassCounts: true }); - + const promises = []; for (const parseClass of this.props.schema.data.get('classes')) { const [className] = parseClass; @@ -998,7 +998,7 @@ class Browser extends DashboardView { }); promises.push(promise); } - + await Promise.all(promises); this.setState({