diff options
author | Hailey <me@haileyok.com> | 2024-06-17 09:05:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 11:05:02 -0500 |
commit | ba2fadb661a9523667fd96e8e8fcb67ac4912792 (patch) | |
tree | e0ab7dc578f09f3a0b35a72ee50f92b588e3851b /src | |
parent | 89be5a442cd6d16d68c40bfe342889e9a2bf0b1e (diff) | |
download | voidsky-ba2fadb661a9523667fd96e8e8fcb67ac4912792.tar.zst |
Don't show "Pin/Add" button on feed card w/ no session (#4539)
* pt 1 * tweak
Diffstat (limited to 'src')
-rw-r--r-- | src/components/FeedCard.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
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} = |