fix(state): check validity of state (#4609)

pull/4734/head
Chaim Lev-Ari 4 years ago committed by GitHub
parent 832cafc933
commit 20d4341170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -179,7 +179,7 @@ angular.module('portainer.app').factory('StateManager', [
} }
var applicationState = LocalStorage.getApplicationState(); var applicationState = LocalStorage.getApplicationState();
if (applicationState) { if (applicationState && applicationState.validity) {
var now = moment().unix(); var now = moment().unix();
var cacheValidity = now - applicationState.validity; var cacheValidity = now - applicationState.validity;
if (cacheValidity > APPLICATION_CACHE_VALIDITY) { if (cacheValidity > APPLICATION_CACHE_VALIDITY) {

Loading…
Cancel
Save