fixed toast for multiple components selection (#7239)

* fixed toast for multiple components selection

* Update frontend/src/_helpers/appUtils.js

Co-authored-by: Chetan Kumar <Chetansain86@gmail.com>

* Resolved the code comments

---------

Co-authored-by: Chetan Kumar <Chetansain86@gmail.com>
Co-authored-by: Kavin Venkatachalam <kavin.saratha@gmail.com>
This commit is contained in:
Chaitanya Kharya 2023-09-28 15:37:08 +05:30 committed by GitHub
parent 607b01baa1
commit 5e0768820e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1383,7 +1383,9 @@ export const cloneComponents = (_ref, updateAppDefinition, isCloning = true, isC
updateAppDefinition(newDefinition);
} else {
navigator.clipboard.writeText(JSON.stringify(newComponentObj));
toast.success('Component copied succesfully');
const successMessage =
newComponentObj.newComponents.length > 1 ? 'Components copied successfully' : 'Component copied successfully';
toast.success(successMessage);
}
_ref.setState({ currentSidebarTab: 2 });
};