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(); });