edit: alt text dans panneau image, gestion des messages vides

This commit is contained in:
2026-04-04 19:08:45 +02:00
parent c94b22444a
commit f56ee81f6d
5 changed files with 18 additions and 6 deletions
+10 -2
View File
@@ -9,8 +9,14 @@ function idAndDate(str){
function titleAndContent(str){
let data = str.split(" :");
let title = data[0];
let contentData = data[1].split("<br>").filter(e => e);
let title = "NO_TITLE";
if (data.length > 1){
title = data[0];
}
let contentData = [""];
if (data[1]){
contentData = data[1].split('<br>').filter(e => e);
}
let content = "";
let src = [];
for(let line of contentData){
@@ -120,6 +126,7 @@ export async function loadPeopleData() {
};
} else if (pouet.media_attachments?.length > 0) {
let textInfos = titleAndContent(pouet.content);
console.log(pouet);
entry = {
id: 'img' + username + infos.id,
date: infos.date,
@@ -128,6 +135,7 @@ export async function loadPeopleData() {
author: username,
caption: textInfos.title + '.star',
src: pouet.media_attachments[0].url,
alt: pouet.media_attachments[0].description,
description: textInfos.content,
like: pouet.favourites_count,
isSelected: false