add autocomplete guards

This commit is contained in:
r888888888
2014-05-23 14:15:26 -04:00
committed by Toks
parent d4b20a0117
commit 507c69d144
+6 -3
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);
}
}
});