Fix opening remounts after merged wall reparenting

This commit is contained in:
sudhir
2026-04-16 13:22:33 +05:30
parent ecb97aba8c
commit b1d8180f62
4 changed files with 19 additions and 6 deletions
@@ -173,7 +173,14 @@ function buildWallMergePlans(
continue
}
const [primary, secondary] = candidates
const sortedCandidates = [...candidates].sort((a, b) => {
const attachmentDiff = (b.children?.length ?? 0) - (a.children?.length ?? 0)
if (attachmentDiff !== 0) {
return attachmentDiff
}
return a.id.localeCompare(b.id)
})
const [primary, secondary] = sortedCandidates
if (
!primary ||
!secondary ||