fix(photo-wall): preserve saved layouts during async photo load (merge, not replace)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cc 2026-06-24 21:37:00 +08:00
parent f88686cd21
commit 624b5eb284

View File

@ -229,7 +229,9 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) {
const t = setTimeout(() => {
try {
const decorations = els.filter((e) => e.type !== 'photo')
const photoLayout: Record<string, PhotoLayout> = {}
// 从已知排版起步而非清空:未加载完/取图失败的照片其排版得以保留,
// 已加载或移动过的照片在下面覆盖各自的 key删除时 removeEl 已从 layoutRef 删键)。
const photoLayout: Record<string, PhotoLayout> = { ...layoutRef.current }
for (const e of els) {
if (e.type === 'photo' && e.photoId) {
photoLayout[e.photoId] = {