From e0fecc7a2fa05d0cb25762c87b15f72f6150dfe9 Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Thu, 25 Jul 2019 12:03:25 -0300 Subject: [PATCH] fix bad password --- src/js/controller.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index 3436860..2a09706 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -654,23 +654,27 @@ angular.module('focaCrearFactura').controller('facturaController', [ return new Promise(function (resolve, reject) { - focaModalService - .prompt({ - titulo: 'Indique Contraseña', - value: '' - }) - .then(function (contraseña) { + function openPrompt() { + return focaModalService + .prompt({ + titulo: 'Indique Contraseña', + value: '' + }) + .then(function (contraseña) { - if (contraseña !== vendedor.ClaVen.trim()) { + if (contraseña !== vendedor.ClaVen.trim()) { - focaModalService.alert('Clave incorrecta').then(function () { - indicarPassword(vendedor); - }); - } else { - resolve(); - } - }) - .catch(reject); + focaModalService.alert('Clave incorrecta').then(function () { + openPrompt(vendedor); + }); + } else { + resolve(); + } + }) + .catch(reject);; + } + + openPrompt() }); } -- 1.9.1