From 8a819321bbb0b2697e3d4e4d813433dd1b1f6dd3 Mon Sep 17 00:00:00 2001 From: Matteo Manzinello Date: Thu, 9 May 2019 09:58:49 +0200 Subject: [PATCH] gestione migliore delle funzioni con arrow function --- src/mailgo.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/mailgo.js b/src/mailgo.js index 0694b29..296a627 100644 --- a/src/mailgo.js +++ b/src/mailgo.js @@ -186,7 +186,7 @@ mailgoInit = () => { event => { copyToClipboard(mail); copy.innerHTML = "copied"; - let timeout = setTimeout(() => { + setTimeout(() => { copy.innerHTML = "copy"; }, 999); }, @@ -261,12 +261,7 @@ copyToClipboard = str => { }; // decrypt email -function mailToEncoded(encoded) { - var address = atob(encoded); - window.location.href = "mailto:" + address; -} +mailToEncoded = encoded => (window.location.href = "mailto:" + atob(encoded)); // encrypt email -function encryptEmail(email) { - return btoa(email); -} +encryptEmail = email => btoa(email);