damus.io

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

commit 331eeb066b85f9a8b314e53c68c6ae0d1d2c0c5b
parent 67b246177171f5dbed4f231bde3f967f7e4110db
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 12 Nov 2022 13:34:02 -0800

web: fix threads not getting expanded

Diffstat:
Mweb/js/damus.js | 2++
Mweb/js/ui/render.js | 5++---
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/web/js/damus.js b/web/js/damus.js @@ -703,6 +703,8 @@ function expand_thread(id) { if (ev) { for (const tag of yield_etags(ev.tags)) DAMUS.expanded.add(tag[1]) + } else { + log_debug("expand_thread, id not found?", id) } DAMUS.expanded.add(id) redraw_events(DAMUS) diff --git a/web/js/ui/render.js b/web/js/ui/render.js @@ -67,7 +67,8 @@ function render_replied_events(model, ev, opts) return "" opts.replies = opts.replies == null ? 1 : opts.replies + 1 - if (!(opts.max_depth == null || opts.replies < opts.max_depth)) + const expanded = model.expanded.has(reply_ev.id) + if (!expanded && !(opts.max_depth == null || opts.replies < opts.max_depth)) return render_thread_collapsed(model, reply_ev, opts) opts.is_reply = true @@ -119,7 +120,6 @@ function render_boost(model, ev, opts) { return render_unknown_event(ev) //const profile = model.profiles[ev.pubkey] - opts.is_boost_event = true opts.boosted = { pubkey: ev.pubkey, profile: model.profiles[ev.pubkey] @@ -182,7 +182,6 @@ function render_event(model, ev, opts={}) { return render_boost(model, ev, opts) if (shouldnt_render_event(model, ev, opts)) return "" - delete opts.is_boost_event model.rendered[ev.id] = true const profile = model.profiles[ev.pubkey] || DEFAULT_PROFILE const delta = time_delta(new Date().getTime(), ev.created_at*1000)