From 9e437c6425d2861540a4a43b6b59fa5d7e1214ea Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Tue, 25 Jul 2023 16:38:57 +0200 Subject: [PATCH] fix: disable follow button if no follow list available --- src/element/follow-button.tsx | 4 +++- src/hooks/follows.ts | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/element/follow-button.tsx b/src/element/follow-button.tsx index 813086d..bf6bee4 100644 --- a/src/element/follow-button.tsx +++ b/src/element/follow-button.tsx @@ -12,7 +12,8 @@ export function LoggedInFollowButton({ pubkey: string; }) { const login = useLogin(); - const { tags, relays } = useFollows(loggedIn, true); + const following = useFollows(loggedIn, true); + const { tags, relays } = following ? following : { tags: [], relays: {} } const follows = tags.filter((t) => t.at(0) === "p") const isFollowing = follows.find((t) => t.at(1) === pubkey); @@ -52,6 +53,7 @@ export function LoggedInFollowButton({ return (