Skip to content

Updating counter in sidebar #1703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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({
Expand Down