feat: enhance profile loading speed

This commit is contained in:
2023-05-10 14:24:22 +01:00
parent 6de9c566e7
commit a56591996b
3 changed files with 19 additions and 6 deletions

View File

@ -17,8 +17,8 @@ export interface ProfilePreviewProps {
}
export default function ProfilePreview(props: ProfilePreviewProps) {
const pubkey = props.pubkey;
const user = useUserProfile(pubkey);
const { ref, inView } = useInView({ triggerOnce: true });
const user = useUserProfile(inView ? pubkey : undefined);
const options = {
about: true,
...props.options,