Commit aa3f5545b30060410eb4876bdcae1575dcf052df
1 parent
1bf6403d2a
Exists in
master
espacio
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/js/app.js
| 1 | angular.module('focaConfiguracion', ['ngStorage']) | 1 | angular.module('focaConfiguracion', ['ngStorage']) |
| 2 | .run([ | 2 | .run([ |
| 3 | '$localStorage', | 3 | '$localStorage', |
| 4 | 'focaConfiguracionService', | 4 | 'focaConfiguracionService', |
| 5 | '$cookies', | 5 | '$cookies', |
| 6 | function($localStorage, focaConfiguracionService, $cookies) { | 6 | function($localStorage, focaConfiguracionService, $cookies) { |
| 7 | if (!$localStorage.terminalKey) { | 7 | if (!$localStorage.terminalKey) { |
| 8 | focaConfiguracionService.getHashTerminal().then(function(res) { | 8 | focaConfiguracionService.getHashTerminal().then(function(res) { |
| 9 | 9 | ||
| 10 | $localStorage.terminalKey = res.data; | 10 | $localStorage.terminalKey = res.data; |
| 11 | 11 | ||
| 12 | }); | 12 | }); |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | if(!$cookies.get('puntoVenta') && $localStorage.terminalKey) { | 15 | if (!$cookies.get('puntoVenta') && $localStorage.terminalKey) { |
| 16 | focaConfiguracionService.getPuntoVenta().then(function(res) { | 16 | focaConfiguracionService.getPuntoVenta().then(function(res) { |
| 17 | 17 | ||
| 18 | $cookies.put('puntoVenta', res.data); | 18 | $cookies.put('puntoVenta', res.data); |
| 19 | }); | 19 | }); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | }]); | 22 | }]); |
| 23 | 23 |