From 5bfe898cdc5aca8b567edcba287db967278a88bf Mon Sep 17 00:00:00 2001 From: yezian Date: Sat, 17 Feb 2024 20:44:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=94=E7=B3=BB=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E9=A1=B5=E9=9D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Contact/index.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/Contact/index.jsx b/src/pages/Contact/index.jsx index 7b9b890..f164a54 100644 --- a/src/pages/Contact/index.jsx +++ b/src/pages/Contact/index.jsx @@ -50,6 +50,8 @@ const ContactContent = (props) => { }, body: JSON.stringify({ mids: userMids, + offset: 0, + limit: 1000, ...base, }), }); @@ -65,7 +67,11 @@ const ContactContent = (props) => { ); return { ...item1, ...matchingItem }; }); - setUnreadMessageList(combinedArray); + //按照时间从新到旧排序 + const orderArray = combinedArray.sort( + (a, b) => b.contents[0].ut - a.contents[0].ut + ); + setUnreadMessageList(orderArray); } catch (error) { console.error(error); }