This repository was archived by the owner on Aug 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 < a class ="nav-link " ui-sref ="authors "> Authors</ a >
1010 </ li >
1111 < li class ="nav-item ">
12- < a class ="nav-link " ui-sref ="books "> Books</ a >
12+ < a class ="nav-link " ui-sref ="books({ filter: null }) "> Books</ a >
1313 </ li >
1414 </ ul >
1515 </ nav >
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ export class HttpStorage {
1212 ) {
1313 this . globalstore = $localForage . createInstance ( { name : 'jsonapiglobal' } ) ;
1414 this . allstore = $localForage . createInstance ( { name : 'allstore' } ) ;
15+ this . checkIfIsTimeToClean ( ) ;
16+ }
1517
18+ private checkIfIsTimeToClean ( ) {
1619 // check if is time to check store
1720 this . globalstore . getItem ( '_lastclean_time' ) . then ( success => {
1821 if ( success ) {
@@ -31,15 +34,13 @@ export class HttpStorage {
3134 this . allstore . keys ( ) . then ( success => {
3235 angular . forEach ( success , ( key ) => {
3336 // recorremos cada item y vemos si es tiempo de removerlo
34- this . allstore . getItem ( key ) . then (
35- success2 => {
36- // es tiempo de removerlo?
37- if ( Date . now ( ) >= ( success2 . _lastupdate_time + 12 * 3600 * 1000 ) ) {
38- // removemos!!
39- this . allstore . removeItem ( key ) ;
40- }
37+ this . allstore . getItem ( key ) . then ( success2 => {
38+ // es tiempo de removerlo?
39+ if ( Date . now ( ) >= ( success2 . _lastupdate_time + 12 * 3600 * 1000 ) ) {
40+ // removemos!!
41+ this . allstore . removeItem ( key ) ;
4142 }
42- ) ;
43+ } ) ;
4344 } ) ;
4445 } ) ;
4546 }
You can’t perform that action at this time.
0 commit comments