refactor: remove unused cache management and selection clearing logic from hooks

This commit is contained in:
kuekhaoyang
2025-11-18 18:11:17 +08:00
parent 694a015a1e
commit 58f7c16d7b
3 changed files with 1 additions and 31 deletions
-13
View File
@@ -11,8 +11,6 @@ const CACHE_KEY = 'kvideo_search_cache';
const CACHE_DURATION = 10 * 60 * 1000; // 10 minutes
export function useSearchCache() {
const hasLoadedCache = useRef(false);
const saveToCache = (
query: string,
results: any[],
@@ -53,19 +51,8 @@ export function useSearchCache() {
}
};
const clearCache = () => {
try {
localStorage.removeItem(CACHE_KEY);
console.log('🗑️ Cache cleared');
} catch (error) {
console.error('Failed to clear cache:', error);
}
};
return {
saveToCache,
loadFromCache,
clearCache,
hasLoadedCache,
};
}