Remove unnecessary function call

This commit is contained in:
carlosmonastyrski
2025-04-02 15:39:31 -03:00
parent d8313a161e
commit ecd39abdc1

View File

@@ -69,8 +69,6 @@ const PasswordGeneratorModal = ({
useEffect(() => { useEffect(() => {
if (isOpen) { if (isOpen) {
generatePassword();
const handleClickOutside = (event: MouseEvent) => { const handleClickOutside = (event: MouseEvent) => {
if (modalRef.current && !modalRef.current.contains(event.target as Node)) { if (modalRef.current && !modalRef.current.contains(event.target as Node)) {
onClose(); onClose();
@@ -95,9 +93,14 @@ const PasswordGeneratorModal = ({
]); ]);
const copyToClipboard = () => { const copyToClipboard = () => {
navigator.clipboard.writeText(password).then(() => { navigator.clipboard
setCopyText("Copied"); .writeText(password)
}); .then(() => {
setCopyText("Copied");
})
.catch(() => {
setCopyText("Copy failed");
});
}; };
const usePassword = () => { const usePassword = () => {