Skip to content

Commit 0d27ef3

Browse files
committed
Add 2 selectors and an if condition inside createBloom
1 parent 68a7bee commit 0d27ef3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

front-end/components/bloom.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ const createBloom = (template, bloom) => {
2020
const bloomRebloomCount = bloomFrag.querySelector("[data-rebloom-count]");
2121
const bloomRebloomLabel = bloomFrag.querySelector("[data-rebloom-label]");
2222
const rebloomButton = bloomFrag.querySelector("[data-action='rebloom']");
23+
const rebloomInfo = bloomFrag.querySelector("[data-rebloom-info]");
24+
const originalUsername = bloomFrag.querySelector("[data-original-username]");
2325

2426
bloomArticle.setAttribute("data-bloom-id", bloom.id);
2527
bloomRebloomCount.textContent = bloom.rebloom_count ?? 0;
2628
bloomUsername.setAttribute("href", `/profile/${bloom.sender}`);
2729
bloomUsername.textContent = bloom.sender;
2830

31+
if (bloom.original_bloom_id) {
32+
rebloomInfo.hidden = false;
33+
originalUsername.textContent = bloom.original_sender;
34+
originalUsername.setAttribute("href", `/bloom/${bloom.original_bloom_id}`);
35+
}
36+
2937
bloomTime.textContent = _formatTimestamp(bloom.sent_timestamp);
3038
bloomTimeLink.setAttribute("href", `/bloom/${bloom.id}`);
3139

0 commit comments

Comments
 (0)