1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-13 22:00:28 +05:30

limit to 10 items

This commit is contained in:
Bnyro 2022-09-11 20:02:34 +02:00 committed by Kavin
parent cdfa850081
commit 09582cb502
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -145,7 +145,7 @@ export default {
if (!query) return;
const searchHistory = JSON.parse(localStorage.getItem("search_history")) ?? [];
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));
},
},