From 48994e01bca2345d56fd0cf72458caa52686e2ec Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Wed, 17 Jun 2026 08:18:34 -0700 Subject: [PATCH] chore(Pulse): gate Follow button behind Pulse feature flag (#1019) Signed-off-by: tho <80c5f18be5aafa62cf6198c6335963ba3306b595288117c8ea2f805fc9bdc94a@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f Co-authored-by: tho <80c5f18be5aafa62cf6198c6335963ba3306b595288117c8ea2f805fc9bdc94a@sprout-oss.stage.blox.sqprod.co> --- .../profile/ui/UserProfilePanelSections.tsx | 48 ++++++++----------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/desktop/src/features/profile/ui/UserProfilePanelSections.tsx b/desktop/src/features/profile/ui/UserProfilePanelSections.tsx index 0d35e909b..20f75011b 100644 --- a/desktop/src/features/profile/ui/UserProfilePanelSections.tsx +++ b/desktop/src/features/profile/ui/UserProfilePanelSections.tsx @@ -38,6 +38,7 @@ import { ProfileAvatar } from "@/features/profile/ui/ProfileAvatar"; import { StatusEmoji } from "@/features/user-status/ui/StatusEmoji"; import { BotIdenticon } from "@/features/messages/ui/BotIdenticon"; import type { ManagedAgent, RelayAgent } from "@/shared/api/types"; +import { useFeatureEnabled } from "@/shared/features"; import { cn } from "@/shared/lib/cn"; import { useNow } from "@/shared/lib/useNow"; import { Badge } from "@/shared/ui/badge"; @@ -430,38 +431,29 @@ function ProfilePrimaryActions({ pubkey: string; unfollowMutation: ReturnType; }) { + const showFollowAction = useFeatureEnabled("pulse"); + const followToggleMutation = isFollowing ? unfollowMutation : followMutation; + + const handleFollowClick = () => { + followToggleMutation.mutate(pubkey, { + onError: (error) => + toast.error( + `${isFollowing ? "Unfollow" : "Follow"} failed: ${error.message}`, + ), + }); + }; + return (
- {isFollowing ? ( + {showFollowAction ? ( - unfollowMutation.mutate(pubkey, { - onError: (error) => - toast.error( - `Unfollow failed: ${error instanceof Error ? error.message : String(error)}`, - ), - }) - } + active={isFollowing} + disabled={followToggleMutation.isPending} + icon={isFollowing ? UserMinus : UserPlus} + label={isFollowing ? "Unfollow" : "Follow"} + onClick={handleFollowClick} /> - ) : ( - - followMutation.mutate(pubkey, { - onError: (error) => - toast.error( - `Follow failed: ${error instanceof Error ? error.message : String(error)}`, - ), - }) - } - /> - )} + ) : null} {onMessage ? (