web: fix re-rendering on reaction

This commit is contained in:
William Casarin 2022-11-14 18:04:56 -08:00
parent 70d0df5240
commit d643e2d06b

View file

@ -350,25 +350,22 @@ function handle_home_event(ids, model, relay, sub_id, ev) {
ev = model.all_events[ev.id] ev = model.all_events[ev.id]
let is_new = false
switch (sub_id) { switch (sub_id) {
case ids.explore: case ids.explore:
const view = model.views.explore const view = model.views.explore
if (should_add_to_explore_timeline(view, ev)) { if (should_add_to_explore_timeline(view, ev)) {
view.seen.add(ev.pubkey) view.seen.add(ev.pubkey)
is_new = insert_event_sorted(view.events, ev) insert_event_sorted(view.events, ev)
} }
if (is_new)
handle_redraw_logic(model, 'explore') handle_redraw_logic(model, 'explore')
break; break;
case ids.home: case ids.home:
if (should_add_to_timeline(ev)) if (should_add_to_timeline(ev))
is_new = insert_event_sorted(model.views.home.events, ev) insert_event_sorted(model.views.home.events, ev)
if (is_new)
handle_redraw_logic(model, 'home') handle_redraw_logic(model, 'home')
break; break;
case ids.account: case ids.account: