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