refactor: use evt as variable name if possible

This was we can use evt.id consistently instead of mental overhead
of textNoteEvent.id
pull/13/head
OFF0 2 years ago
parent 06686ba9a7
commit 7d9f31f7c6
Signed by: offbyn
GPG Key ID: 94A2F643C51F37FA

@ -132,18 +132,18 @@ const sortByCreatedAt = (evt1, evt2) => {
function renderFeed() {
const sortedFeeds = textNoteList.sort(sortByCreatedAt).reverse();
sortedFeeds.forEach((textNoteEvent, i) => {
if (feedDomMap[textNoteEvent.id]) {
sortedFeeds.forEach((evt, i) => {
if (feedDomMap[evt.id]) {
// TODO check eventRelayMap if event was published to different relays
return;
}
const article = createTextNote(textNoteEvent, eventRelayMap[textNoteEvent.id]);
const article = createTextNote(evt, eventRelayMap[evt.id]);
if (i === 0) {
feedContainer.append(article);
} else {
feedDomMap[sortedFeeds[i - 1].id].before(article);
}
feedDomMap[textNoteEvent.id] = article;
feedDomMap[evt.id] = article;
});
}

Loading…
Cancel
Save