From d825d3772af6c1066bf8fc0ffdc1af3ee55e9449 Mon Sep 17 00:00:00 2001 From: Prerna Mehra Date: Wed, 21 Apr 2021 09:35:46 +0530 Subject: [PATCH] showing error message on failed clone row task (#1687) --- src/dashboard/Data/Browser/Browser.react.js | 23 +++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 7f99afff8e..7c7947edc0 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -821,15 +821,20 @@ class Browser extends DashboardView { for (const object of objects) { toClone.push(object.clone()); } - await Parse.Object.saveAll(toClone, { useMasterKey: true }); - this.setState({ - selection: {}, - data: [ - ...toClone, - ...this.state.data, - ], - showCloneSelectedRowsDialog: false, - }); + try { + await Parse.Object.saveAll(toClone, { useMasterKey: true }); + this.setState({ + selection: {}, + data: [...toClone, ...this.state.data], + showCloneSelectedRowsDialog: false + }); + } catch (error) { + this.setState({ + selection: {}, + showCloneSelectedRowsDialog: false + }); + this.showNote(error.message, true); + } } getClassRelationColumns(className) {