История: сортировка групп по дате — новые фотографии вверху

This commit is contained in:
2026-08-26 19:57:55 +07:00
parent f91aa94336
commit 1c36a21e0c
2 changed files with 10 additions and 8 deletions

View File

@@ -698,12 +698,14 @@ function renderHistory() {
empty.hidden = historyVersions.length > 0;
const childrenMap = buildChildrenMap(historyVersions);
const roots = historyVersions.filter(
(version) =>
version.kind === "original" ||
!version.parentId ||
!childrenMap.has(version.parentId)
);
const roots = historyVersions
.filter(
(version) =>
version.kind === "original" ||
!version.parentId ||
!childrenMap.has(version.parentId)
)
.sort((a, b) => String(b.createdAt || "").localeCompare(String(a.createdAt || "")));
rebuildReferenceSelect();