From 1cfef22465232bdf6992e9a21be2029a8b5ec002 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 30 Jan 2023 20:30:45 +0800 Subject: [PATCH] Let's test this out --- src/pages/home.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/home.jsx b/src/pages/home.jsx index 2ad49547..00cb8bef 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -36,6 +36,12 @@ function Home({ hidden }) { } const allStatuses = await homeIterator.current.next(); if (allStatuses.value?.length) { + // ENFORCE sort by datetime (Latest first) + allStatuses.value.sort((a, b) => { + const aDate = new Date(a.createdAt); + const bDate = new Date(b.createdAt); + return bDate - aDate; + }); const homeValues = allStatuses.value.map((status) => { saveStatus(status); return {