web: fix threads not getting expanded

This commit is contained in:
William Casarin 2022-11-12 13:34:02 -08:00
parent 67b2461771
commit 331eeb066b
2 changed files with 4 additions and 3 deletions

View file

@ -703,6 +703,8 @@ function expand_thread(id) {
if (ev) { if (ev) {
for (const tag of yield_etags(ev.tags)) for (const tag of yield_etags(ev.tags))
DAMUS.expanded.add(tag[1]) DAMUS.expanded.add(tag[1])
} else {
log_debug("expand_thread, id not found?", id)
} }
DAMUS.expanded.add(id) DAMUS.expanded.add(id)
redraw_events(DAMUS) redraw_events(DAMUS)

View file

@ -67,7 +67,8 @@ function render_replied_events(model, ev, opts)
return "" return ""
opts.replies = opts.replies == null ? 1 : opts.replies + 1 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) return render_thread_collapsed(model, reply_ev, opts)
opts.is_reply = true opts.is_reply = true
@ -119,7 +120,6 @@ function render_boost(model, ev, opts) {
return render_unknown_event(ev) return render_unknown_event(ev)
//const profile = model.profiles[ev.pubkey] //const profile = model.profiles[ev.pubkey]
opts.is_boost_event = true
opts.boosted = { opts.boosted = {
pubkey: ev.pubkey, pubkey: ev.pubkey,
profile: model.profiles[ev.pubkey] profile: model.profiles[ev.pubkey]
@ -182,7 +182,6 @@ function render_event(model, ev, opts={}) {
return render_boost(model, ev, opts) return render_boost(model, ev, opts)
if (shouldnt_render_event(model, ev, opts)) if (shouldnt_render_event(model, ev, opts))
return "" return ""
delete opts.is_boost_event
model.rendered[ev.id] = true model.rendered[ev.id] = true
const profile = model.profiles[ev.pubkey] || DEFAULT_PROFILE const profile = model.profiles[ev.pubkey] || DEFAULT_PROFILE
const delta = time_delta(new Date().getTime(), ev.created_at*1000) const delta = time_delta(new Date().getTime(), ev.created_at*1000)