Commit d96aa184f5
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/Search.vue +1 −3
| @@ -290,8 +290,6 @@ interface SearchHistoryEntry { | ||
| 290 | 290 | href?: string |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | const MAX_HISTORY = 12 | |
| 294 | ||
| 295 | 293 | const saveHistoryEnabled = useLocalStorage('vitepress:local-search-save-history', false) |
| 296 | 294 | |
| 297 | 295 | const searchHistory = useLocalStorage<SearchHistoryEntry[]>( |
| @@ -312,7 +310,7 @@ function saveToHistory(query: string, mode: SearchMode, path?: string[], href?: | ||
| 312 | 310 | ...searchHistory.value.filter( |
| 313 | 311 | (h) => !(h.query === trimmed && h.mode === mode && (h.path ?? []).join('\n') === pathKey) |
| 314 | 312 | ) |
| 315 | ].slice(0, MAX_HISTORY) | |
| 313 | ] | |
| 316 | 314 | } |
| 317 | 315 | |
| 318 | 316 | function removeFromHistory(index: number) { |