edit: tri des messages plus récent en haut

This commit is contained in:
2026-04-04 19:18:32 +02:00
parent f56ee81f6d
commit 3f9b63309d
3 changed files with 6 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ export async function loadMsgData() {
let entry = {
title: textInfos.title,
date: dateInfos.date,
dateInfo: pouet.created_at,
content: textInfos.content,
like: pouet.favourites_count,
isLiked: false,

View File

@@ -4,6 +4,7 @@ export const dataStorage = reactive({
selectedMsg: {
title: '',
date: '',
dateInfo: '',
content: '',
like: 0,
isLiked: false,

View File

@@ -243,6 +243,9 @@
if (!this.msgList[j].wasRead)
this.msgNumber += 1;
}
},
organizeItems(){
this.msgList.sort((a,b) => b.dateInfo.localeCompare(a.dateInfo));
}
},
data(){
@@ -262,6 +265,7 @@
},
async mounted(){
this.msgList = await loadMsgData();
this.organizeItems();
//console.log(this.msgList);
this.msgNumber = this.msgList.length
console.log("Inbox content is loaded!");