Refactor SearchHeader and ImageViewer components for improved functionality

- Updated ImageViewer.vue to enhance event handling for image navigation.
- Refactored SearchHeader.vue to streamline search history management by removing direct persistence calls and utilizing historyStore for unified management.
This commit is contained in:
AdingApkgg
2025-12-27 08:17:16 +08:00
parent 22a05a35a7
commit 5342ec75d5
2 changed files with 2 additions and 11 deletions

View File

@@ -54,8 +54,8 @@ function handlePrev(e: Event) {
// 下一张
function handleNext(e: Event) {
e.stopPropagation()
next()
playSwipe()
next()
}
// 键盘事件

View File

@@ -493,7 +493,6 @@ import {
Star,
} from 'lucide-vue-next'
import { getSearchParamsFromURL, updateURLParams, onURLParamsChange } from '@/utils/urlParams'
import { saveSearchHistory } from '@/utils/persistence'
const searchStore = useSearchStore()
const statsStore = useStatsStore()
@@ -698,15 +697,7 @@ async function handleSearch() {
})
}
// 保存搜索历史到持久化存储
saveSearchHistory({
query: searchQuery.value.trim(),
mode: searchMode.value,
timestamp: Date.now(),
resultCount,
})
// 同时添加到 historyStore
// 保存搜索历史(通过 historyStore 统一管理)
historyStore.addHistory({
query: searchQuery.value.trim(),
mode: searchMode.value,