fix(photo-wall): clear stale photos + revoke object URLs before (re)loading
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
a9905b4fa7
commit
dba517df4e
@ -283,6 +283,10 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) {
|
||||
let alive = true
|
||||
;(async () => {
|
||||
try {
|
||||
// 重新加载前清掉旧会话的照片,避免重复堆叠与 objectURL 泄漏
|
||||
for (const u of objUrls.current) URL.revokeObjectURL(u)
|
||||
objUrls.current = []
|
||||
setEls((prev) => prev.filter((e) => e.type !== 'photo'))
|
||||
const { items } = await listPhotos(token)
|
||||
for (const item of items) {
|
||||
let url: string
|
||||
|
||||
Loading…
Reference in New Issue
Block a user