From ba37141e17150c3d016f3ca47a739406c4065b10 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Sun, 8 Apr 2018 00:41:06 +0200 Subject: [PATCH] Clean code in PasswordGenerator.vue component --- src/views/PasswordGenerator.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/PasswordGenerator.vue b/src/views/PasswordGenerator.vue index 50ad589..106e6aa 100644 --- a/src/views/PasswordGenerator.vue +++ b/src/views/PasswordGenerator.vue @@ -172,12 +172,13 @@ export default { this.passwordGenerated = ""; this.$refs.masterPassword.hidePassword(); }, - cleanFormInSeconds(seconds = 15) { + cleanFormIn30Seconds() { + const thirtySecondsInMillisecond = 30 * 1000; this.cleanTimeout = setTimeout(() => { this.masterPassword = ""; this.passwordGenerated = ""; this.$refs.masterPassword.hidePassword(); - }, 1000 * seconds); + }, thirtySecondsInMillisecond); }, generatePassword() { const site = this.password.site; @@ -209,7 +210,7 @@ export default { passwordProfile ).then(passwordGenerated => { this.passwordGenerated = passwordGenerated; - this.cleanFormInSeconds(30); + this.cleanFormIn30Seconds(); }); }, focusBestInputField() {