hoist remove prompt out of conditional
confirming the prompt optimistically drops the row, which would unmount the prompt mid-close and race the dismiss animation on native. only the button needs gating behind showRemoveButton. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -153,22 +153,15 @@ export function Member({
|
||||
</ProfileCard.Outer>
|
||||
</ProfileCard.Link>
|
||||
{showRemoveButton ? (
|
||||
<>
|
||||
<Button
|
||||
label={l`Remove ${displayName} from this group chat`}
|
||||
size="tiny"
|
||||
color="negative_subtle"
|
||||
onPress={() => removeMemberPrompt.open()}>
|
||||
<ButtonText>
|
||||
<Trans>Remove</Trans>
|
||||
</ButtonText>
|
||||
</Button>
|
||||
<RemoveMemberPrompt
|
||||
control={removeMemberPrompt}
|
||||
displayName={displayName}
|
||||
onConfirm={() => removeMembers({members: [profile.did]})}
|
||||
/>
|
||||
</>
|
||||
<Button
|
||||
label={l`Remove ${displayName} from this group chat`}
|
||||
size="tiny"
|
||||
color="negative_subtle"
|
||||
onPress={() => removeMemberPrompt.open()}>
|
||||
<ButtonText>
|
||||
<Trans>Remove</Trans>
|
||||
</ButtonText>
|
||||
</Button>
|
||||
) : isSelf || isFollowing || isBlockedOrBlocking(profile) ? null : (
|
||||
<SimpleInlineLinkText
|
||||
label={l`Follow ${displayName}`}
|
||||
@@ -179,6 +172,14 @@ export function Member({
|
||||
)}
|
||||
{statusBadge}
|
||||
</View>
|
||||
{/* Mounted outside the showRemoveButton conditional: confirming the
|
||||
prompt optimistically drops this row, so gating the prompt on the
|
||||
button would unmount it mid-close and race the dismiss animation. */}
|
||||
<RemoveMemberPrompt
|
||||
control={removeMemberPrompt}
|
||||
displayName={displayName}
|
||||
onConfirm={() => removeMembers({members: [profile.did]})}
|
||||
/>
|
||||
</SubtleHoverWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user