Commit e0fecc7a2fa05d0cb25762c87b15f72f6150dfe9

Authored by Eric Fernandez
1 parent 1d6ba7bafe
Exists in master

fix bad password

Showing 1 changed file with 19 additions and 15 deletions   Show diff stats
src/js/controller.js
... ... @@ -654,23 +654,27 @@ angular.module('focaCrearFactura').controller('facturaController', [
654 654  
655 655 return new Promise(function (resolve, reject) {
656 656  
657   - focaModalService
658   - .prompt({
659   - titulo: 'Indique Contraseña',
660   - value: ''
661   - })
662   - .then(function (contraseña) {
  657 + function openPrompt() {
  658 + return focaModalService
  659 + .prompt({
  660 + titulo: 'Indique Contraseña',
  661 + value: ''
  662 + })
  663 + .then(function (contraseña) {
663 664  
664   - if (contraseña !== vendedor.ClaVen.trim()) {
  665 + if (contraseña !== vendedor.ClaVen.trim()) {
665 666  
666   - focaModalService.alert('Clave incorrecta').then(function () {
667   - indicarPassword(vendedor);
668   - });
669   - } else {
670   - resolve();
671   - }
672   - })
673   - .catch(reject);
  667 + focaModalService.alert('Clave incorrecta').then(function () {
  668 + openPrompt(vendedor);
  669 + });
  670 + } else {
  671 + resolve();
  672 + }
  673 + })
  674 + .catch(reject);;
  675 + }
  676 +
  677 + openPrompt()
674 678 });
675 679 }
676 680