From 56e06d81dc38a77fbd360be1bea7f264cd68aaeb Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Thu, 18 Jan 2024 16:11:13 +0100 Subject: [PATCH] Fix profile linking from follower lists --- src/pages/Profile.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/pages/Profile.tsx b/src/pages/Profile.tsx index c352c7a..fee6fd1 100644 --- a/src/pages/Profile.tsx +++ b/src/pages/Profile.tsx @@ -25,7 +25,7 @@ import { shortDate } from '../lib/dates'; import styles from './Profile.module.scss'; import StickySidebar from '../components/StickySidebar/StickySidebar'; import ProfileSidebar from '../components/ProfileSidebar/ProfileSidebar'; -import { MenuItem, VanityProfiles } from '../types/primal'; +import { MenuItem, PrimalUser, VanityProfiles } from '../types/primal'; import PageTitle from '../components/PageTitle/PageTitle'; import FollowButton from '../components/FollowButton/FollowButton'; import Search from '../components/Search/Search'; @@ -42,6 +42,7 @@ import VerificationCheck from '../components/VerificationCheck/VerificationCheck import PhotoSwipeLightbox from 'photoswipe/lightbox'; import NoteImage from '../components/NoteImage/NoteImage'; +import { createStore } from 'solid-js/store'; const Profile: Component = () => { @@ -96,6 +97,20 @@ const Profile: Component = () => { return hex; } + let firstTime = true; + + createEffect(() => { + const npub = params.npub; + + if (firstTime && npub) { + firstTime = false; + return; + } + + setProfile(getHex()); + + }) + const setProfile = (hex: string | undefined) => { profile?.actions.setProfileKey(hex); @@ -454,7 +469,6 @@ const Profile: Component = () => { } }); - onMount(() => { lightbox.init(); });