From c50d16c0c6a946633ad7b6324318564442409dec Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Wed, 21 Sep 2016 20:44:17 +0200 Subject: [PATCH] Fixed an issue with history truncation --- res/search.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/res/search.js b/res/search.js index ddf2db7..4f3184c 100644 --- a/res/search.js +++ b/res/search.js @@ -21,8 +21,7 @@ var search_history = { return x != query; }); tmp.push(query); - tmp = tmp.slice(Math.max(0, tmp.length - tmp.max_size)); - localStorage.setItem('history', JSON.stringify(tmp)); + localStorage.setItem('history', JSON.stringify(tmp.slice(0, tmp.max_size))); } }; -- GitLab