Remove getSuggestedFollowsByActor fallbacks and use recIdStr (#9988)

This commit is contained in:
DS Boyce
2026-03-12 16:57:38 -07:00
committed by GitHub
parent 35cb2bcf94
commit 0b6ff8000d
6 changed files with 148 additions and 336 deletions
@@ -75,6 +75,8 @@ let ProfileHeaderStandard = ({
const [, queueUnblock] = useProfileBlockMutationQueue(profile)
const unblockPromptControl = Prompt.usePromptControl()
const [showSuggestedFollows, setShowSuggestedFollows] = useState(false)
const [hasSeenAllSuggestedFollows, setHasSeenAllSuggestedFollows] =
useState(false)
const isBlockedUser =
profile.viewer?.blocking ||
profile.viewer?.blockedBy ||
@@ -84,7 +86,8 @@ let ProfileHeaderStandard = ({
try {
await queueUnblock()
Toast.show(_(msg({message: 'Account unblocked', context: 'toast'})))
} catch (e: any) {
} catch (err) {
const e = err as Error
if (e?.name !== 'AbortError') {
logger.error('Failed to unblock account', {message: e})
Toast.show(_(msg`There was an issue! ${e.toString()}`), {type: 'error'})
@@ -92,6 +95,11 @@ let ProfileHeaderStandard = ({
}
}
const onRequestHide = () => {
setHasSeenAllSuggestedFollows(true)
setShowSuggestedFollows(false)
}
const isMe = currentAccount?.did === profile.did
const {isActive: live} = useActorStatus(profile)
@@ -192,7 +200,9 @@ let ProfileHeaderStandard = ({
description={_(
msg`The account will be able to interact with you after unblocking.`,
)}
onConfirm={unblockAccount}
onConfirm={() => {
void unblockAccount()
}}
confirmButtonCta={
profile.viewer?.blocking ? _(msg`Unblock`) : _(msg`Block`)
}
@@ -201,8 +211,9 @@ let ProfileHeaderStandard = ({
</ProfileHeaderShell>
<ProfileHeaderSuggestedFollows
isExpanded={showSuggestedFollows}
isExpanded={!hasSeenAllSuggestedFollows && showSuggestedFollows}
actorDid={profile.did}
onRequestHide={onRequestHide}
/>
</>
)
@@ -254,7 +265,8 @@ export function HeaderStandardButtons({
)}`,
),
)
} catch (e: any) {
} catch (err) {
const e = err as Error
if (e?.name !== 'AbortError') {
logger.error('Failed to follow', {message: String(e)})
Toast.show(_(msg`There was an issue! ${e.toString()}`), {
@@ -280,7 +292,8 @@ export function HeaderStandardButtons({
),
{type: 'default'},
)
} catch (e: any) {
} catch (err) {
const e = err as Error
if (e?.name !== 'AbortError') {
logger.error('Failed to unfollow', {message: String(e)})
Toast.show(_(msg`There was an issue! ${e.toString()}`), {
@@ -295,7 +308,8 @@ export function HeaderStandardButtons({
try {
await queueUnblock()
Toast.show(_(msg({message: 'Account unblocked', context: 'toast'})))
} catch (e: any) {
} catch (err) {
const e = err as Error
if (e?.name !== 'AbortError') {
logger.error('Failed to unblock account', {message: e})
Toast.show(_(msg`There was an issue! ${e.toString()}`), {type: 'error'})
@@ -400,7 +414,9 @@ export function HeaderStandardButtons({
description={_(
msg`The account will be able to interact with you after unblocking.`,
)}
onConfirm={unblockAccount}
onConfirm={() => {
void unblockAccount()
}}
confirmButtonCta={_(msg`Unblock`)}
confirmButtonColor="negative"
/>