0.0.9.0
This commit is contained in:
@@ -1,16 +1,4 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { db } from '@/lib/db'
|
||||
|
||||
// 全局图片缓存
|
||||
const avatarCache = new Map<string, string>()
|
||||
|
||||
// 简化的 hook,直接返回 URL
|
||||
export function useAvatarCache(avatarUrl?: string) {
|
||||
return { avatarUrl, isLoading: false }
|
||||
}
|
||||
|
||||
// 清理缓存的工具函数(可选)
|
||||
export function clearAvatarCache() {
|
||||
avatarCache.forEach((url) => URL.revokeObjectURL(url))
|
||||
avatarCache.clear()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user