From ba2fadb661a9523667fd96e8e8fcb67ac4912792 Mon Sep 17 00:00:00 2001
From: Hailey <me@haileyok.com>
Date: Mon, 17 Jun 2024 09:05:02 -0700
Subject: Don't show "Pin/Add" button on feed card w/ no session (#4539)

* pt 1

* tweak
---
 src/components/FeedCard.tsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/components/FeedCard.tsx')

diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx
index 2745ed7c9..94d97cb62 100644
--- a/src/components/FeedCard.tsx
+++ b/src/components/FeedCard.tsx
@@ -11,6 +11,7 @@ import {
   useRemoveFeedMutation,
 } from '#/state/queries/preferences'
 import {sanitizeHandle} from 'lib/strings/handles'
+import {useSession} from 'state/session'
 import {UserAvatar} from '#/view/com/util/UserAvatar'
 import * as Toast from 'view/com/util/Toast'
 import {useTheme} from '#/alf'
@@ -116,6 +117,12 @@ export function Likes({count}: {count: number}) {
 }
 
 export function Action({uri, pin}: {uri: string; pin?: boolean}) {
+  const {hasSession} = useSession()
+  if (!hasSession) return null
+  return <ActionInner uri={uri} pin={pin} />
+}
+
+function ActionInner({uri, pin}: {uri: string; pin?: boolean}) {
   const {_} = useLingui()
   const {data: preferences} = usePreferencesQuery()
   const {isPending: isAddSavedFeedPending, mutateAsync: saveFeeds} =
-- 
cgit 1.4.1

