mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-25 14:07:00 +00:00
limit to 10 items
This commit is contained in:
parent
cdfa850081
commit
09582cb502
@ -145,7 +145,7 @@ export default {
|
|||||||
if (!query) return;
|
if (!query) return;
|
||||||
const searchHistory = JSON.parse(localStorage.getItem("search_history")) ?? [];
|
const searchHistory = JSON.parse(localStorage.getItem("search_history")) ?? [];
|
||||||
if (!searchHistory.includes(query)) searchHistory.push(query);
|
if (!searchHistory.includes(query)) searchHistory.push(query);
|
||||||
if (searchHistory.length > 3) searchHistory.shift();
|
if (searchHistory.length > 10) searchHistory.shift();
|
||||||
localStorage.setItem("search_history", JSON.stringify(searchHistory));
|
localStorage.setItem("search_history", JSON.stringify(searchHistory));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user