From b18c58581badd515f640ec772ba0ee25fa1bcfb8 Mon Sep 17 00:00:00 2001 From: sadakchap Date: Mon, 10 May 2021 17:28:06 +0530 Subject: [PATCH] updating counter in sidebar on success clone rows --- src/dashboard/Data/Browser/Browser.react.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index d4c4c750fb..898f9c6cd4 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -826,7 +826,8 @@ class Browser extends DashboardView { for (const objectId in this.state.selection) { objectIds.push(objectId); } - const query = new Parse.Query(this.props.params.className); + const className = this.props.params.className; + const query = new Parse.Query(className); query.containedIn('objectId', objectIds); const objects = await query.find({ useMasterKey: true }); const toClone = []; @@ -838,7 +839,11 @@ class Browser extends DashboardView { this.setState({ selection: {}, data: [...toClone, ...this.state.data], - showCloneSelectedRowsDialog: false + showCloneSelectedRowsDialog: false, + counts: { + ...this.state.counts, + [className]: this.state.counts[className] + toClone.length + } }); } catch (error) { this.setState({