enable follow button when logged in

This commit is contained in:
mr0x50
2025-02-09 19:23:05 +01:00
committed by highperfocused
parent 7092821880
commit f21d1990a3

View File

@@ -24,7 +24,7 @@ const FollowButton: React.FC<FollowButtonProps> = ({ pubkey, userPubkey }) => {
isLoggedIn = storedPubkey !== null;
}
const { events } = useNostrEvents({
const { events, isLoading } = useNostrEvents({
filter: {
kinds: [3],
authors: [userPubkey],
@@ -88,7 +88,7 @@ const FollowButton: React.FC<FollowButtonProps> = ({ pubkey, userPubkey }) => {
};
return (
<Button className='w-full' onClick={handleFollow} disabled>
<Button className='w-full' onClick={handleFollow} disabled={isLoading || !isLoggedIn}>
{isFollowing ? 'Unfollow' : 'Follow'}
</Button>
);