mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-22 12:13:43 +08:00
refactor: remove unused cache management and selection clearing logic from hooks
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user