Update profile page for new fields

This commit is contained in:
Thomas Mathews 2023-01-24 18:03:41 -08:00
parent 7ff9394795
commit e2a1ab5aa7
6 changed files with 97 additions and 33 deletions

View file

@ -134,10 +134,11 @@ function view_timeline_apply_mode(model, mode, opts={}, push_state=true) {
.classList.toggle("hide", mode != VM_FRIENDS);
// Show/hide different profile image in header
el_their_pfp = find_node("#view header img.pfp[role='their-pfp']");
el_their_pfp.classList.toggle("hide", mode != VM_DM_THREAD);
const show_mypfp = mode != VM_DM_THREAD && mode != VM_USER;
const el_their_pfp = find_node("#view header img.pfp[role='their-pfp']");
el_their_pfp.classList.toggle("hide", show_mypfp);
find_node("#view header img.pfp[role='my-pfp']")
.classList.toggle("hide", mode == VM_DM_THREAD);
.classList.toggle("hide", !show_mypfp);
view_timeline_refresh(model, mode, opts);
@ -157,6 +158,11 @@ function view_timeline_apply_mode(model, mode, opts={}, push_state=true) {
view_show_spinner(false);
view_set_show_count(0, true, true);
break;
case VM_USER:
el_their_pfp.src = get_profile_pic(profile);
el_their_pfp.dataset.pubkey = pubkey;
view_update_profile(model, pubkey);
break;
}
return mode;
@ -666,6 +672,12 @@ function onclick_any(ev) {
case "open-media":
open_media_preview(el.src, el.dataset.type);
break;
case "open-link":
window.open(el.dataset.url, "_blank");
break;
case "open-lud06":
open_lud06(el.dataset.lud06);
break;
case "show-event-json":
on_click_show_event_details(el.dataset.evid);
break;