add autocomplete guards

This commit is contained in:
r888888888
2014-05-09 17:42:40 -07:00
parent 16c1a45066
commit 852e28b032

View File

@@ -23,9 +23,12 @@
if (this.enable_local_storage) {
var now = new Date().getTime();
$.each($.localStorage.keys(), function(i, key) {
var expiry = Date.parse($.localStorage.get(key));
if (expiry < now) {
$.localStorage.remove(key);
var obj = $.localStorage.get(key);
if (obj && obj.expires) {
var expiry = Date.parse(obj.expires);
if (expiry < now) {
$.localStorage.remove(key);
}
}
});