From ecd39abdc1019dd36e72baa2b4d8fbfa0e47e64f Mon Sep 17 00:00:00 2001 From: carlosmonastyrski Date: Wed, 2 Apr 2025 15:39:31 -0300 Subject: [PATCH] Remove unnecessary function call --- .../v2/PasswordGenerator/PasswordGenerator.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/v2/PasswordGenerator/PasswordGenerator.tsx b/frontend/src/components/v2/PasswordGenerator/PasswordGenerator.tsx index 79e823ab4..1f17e2e53 100644 --- a/frontend/src/components/v2/PasswordGenerator/PasswordGenerator.tsx +++ b/frontend/src/components/v2/PasswordGenerator/PasswordGenerator.tsx @@ -69,8 +69,6 @@ const PasswordGeneratorModal = ({ useEffect(() => { if (isOpen) { - generatePassword(); - const handleClickOutside = (event: MouseEvent) => { if (modalRef.current && !modalRef.current.contains(event.target as Node)) { onClose(); @@ -95,9 +93,14 @@ const PasswordGeneratorModal = ({ ]); const copyToClipboard = () => { - navigator.clipboard.writeText(password).then(() => { - setCopyText("Copied"); - }); + navigator.clipboard + .writeText(password) + .then(() => { + setCopyText("Copied"); + }) + .catch(() => { + setCopyText("Copy failed"); + }); }; const usePassword = () => {