Sort the ancestors and descendants

This commit is contained in:
Lim Chee Aun 2024-10-28 18:47:47 +08:00
parent 8f3077b06b
commit dd3b064aec

View file

@ -321,6 +321,10 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
const context = await contextFetch; const context = await contextFetch;
const { ancestors, descendants } = context; const { ancestors, descendants } = context;
// Sort oldest first
ancestors.sort((a, b) => a.createdAt - b.createdAt);
descendants.sort((a, b) => a.createdAt - b.createdAt);
totalDescendants.current = descendants?.length || 0; totalDescendants.current = descendants?.length || 0;
const missingStatuses = new Set(); const missingStatuses = new Set();