Client: Improve CLI

* Informative message for Renotes and Replies
This commit is contained in:
ltlapy 2022-09-29 12:52:36 +09:00
parent 8ef8be1f9d
commit 13b554f2db

View file

@ -43,10 +43,26 @@ window.onload = async () => {
const tl = document.getElementById('tl');
for (const note of notes) {
const el = document.createElement('div');
const name = document.createElement('header');
name.textContent = `${note.user.name} @${note.user.username}`;
const text = document.createElement('div');
text.textContent = `${note.text}`;
if (note.renoteId !== null) {
const renoteTextShrinked = note.renote.text.slice(0, 30).concat('...');
text.innerHTML = '<i>';
text.textContent = `Renote of @${note.renote.user.username}'s note: ${renoteTextShrinked}\n`;
text.innerHTML += '</i>';
}
if (note.replyId !== null) {
const replyTextShrinked = note.reply.text.slice(0, 30).concat('...');
text.innerHTML = '<i>';
text.textContent = `Reply of @${note.reply.user.username}'s note: ${replyTextShrinked}\n`;
text.innerHTML += '</i>';
}
text.textContent += `${note.text || ''}`;
el.appendChild(name);
el.appendChild(text);
tl.appendChild(el);