From bfc1684375b7c2120e2a4ae566e5b3c38c0ca110 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 6 Sep 2022 11:06:06 -0500 Subject: [PATCH] fix: unnecessary count operations in Data Browser (#2250) --- src/dashboard/Data/Browser/Browser.react.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 341c46f9d3..d1dbaa5c07 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -171,10 +171,11 @@ class Browser extends DashboardView { if (this.props.params.appId !== nextProps.params.appId || !this.props.params.className) { this.setState({ counts: {} }); Parse.Object._clearAllState(); + + nextProps.schema.dispatch(ActionTypes.FETCH) + .then(() => this.handleFetchedSchema()); } this.prefetchData(nextProps, nextContext); - nextProps.schema.dispatch(ActionTypes.FETCH) - .then(() => this.handleFetchedSchema()); } if (!nextProps.params.className && nextProps.schema.data.get('classes')) { this.redirectToFirstClass(nextProps.schema.data.get('classes'), nextContext);