summary refs log tree commit diff
path: root/_layouts/default.html
diff options
context:
space:
mode:
Diffstat (limited to '_layouts/default.html')
-rw-r--r--_layouts/default.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/_layouts/default.html b/_layouts/default.html
index 3669255..ded6615 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -31,7 +31,12 @@
   function getSearchJSON(callback) {
     var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf()));
     if (!searchData) {
-      localStorage.clear();
+      for (var i = 0; i < localStorage.length; i++) {
+          var key = localStorage.key(i);
+          if (key.startsWith('blog_')) {
+              localStorage.removeItem(key);
+          }
+      }
       $.getJSON("/search.json", function (data) {
           localStorage.setItem("blog_" + lastUpdated.valueOf(), JSON.stringify(data));
           callback(data);