Fix profile linking from follower lists

This commit is contained in:
Bojan Mojsilovic 2024-01-18 16:11:13 +01:00
parent 729af39c48
commit 56e06d81dc

View File

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