damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README

commit 20a0be49431f8c61b64684e1f19c1b5dbc028818
parent c2cd952697c7b21c316ac2a4e73cc9b640235890
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 30 Oct 2022 11:16:13 -0700

add reder_event max depth in reply modal

so it doesn't get too large

Diffstat:
Mwebv2/damus.js | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/webv2/damus.js b/webv2/damus.js @@ -542,8 +542,10 @@ function render_event(model, ev, opts={}) { if (reply_ev) { opts.replies = opts.replies == null ? 1 : opts.replies + 1 opts.is_reply = true - replying_to = render_event(model, reply_ev, opts) - reply_line_top = render_reply_line_top() + if (opts.max_depth == null || opts.replies < opts.max_depth) { + replying_to = render_event(model, reply_ev, opts) + reply_line_top = render_reply_line_top() + } } } @@ -781,7 +783,7 @@ function reply_to(evid) { replying_to.dataset.evid = evid const ev = DSTATE.all_events[evid] - replying_to.innerHTML = render_event(DSTATE, ev, {is_composing: true, nobar: true}) + replying_to.innerHTML = render_event(DSTATE, ev, {is_composing: true, nobar: true, max_depth: 2}) modal.style.display = replying? "block" : "none"; }