fix(card-sorting): filter local player from emoji overlays on dragged cards
When a player drags a card in their own window, they should not see their own emoji overlay on that card. The emoji overlay should only appear when OTHER players are dragging cards (for multiplayer awareness). Changes: - Add localPlayerId prop to AnimatedCard component - Filter emoji overlay condition: draggedByPlayerId !== localPlayerId - Pass localPlayerId when rendering AnimatedCard Fixes regression where local player's emoji showed on their own dragged cards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -691,6 +691,7 @@ function AnimatedCard({
|
||||
isSpectating,
|
||||
isCorrect,
|
||||
draggedByPlayerId,
|
||||
localPlayerId,
|
||||
players,
|
||||
viewportWidth,
|
||||
viewportHeight,
|
||||
@@ -705,6 +706,7 @@ function AnimatedCard({
|
||||
isSpectating: boolean
|
||||
isCorrect: boolean
|
||||
draggedByPlayerId?: string
|
||||
localPlayerId?: string
|
||||
players: Map<string, { id: string; name: string; emoji: string }>
|
||||
viewportWidth: number
|
||||
viewportHeight: number
|
||||
@@ -776,8 +778,9 @@ function AnimatedCard({
|
||||
dangerouslySetInnerHTML={{ __html: card.svgContent }}
|
||||
/>
|
||||
|
||||
{/* Player emoji overlay when card is being dragged by a player */}
|
||||
{/* Player emoji overlay when card is being dragged by ANOTHER player */}
|
||||
{draggedByPlayerId &&
|
||||
draggedByPlayerId !== localPlayerId &&
|
||||
(() => {
|
||||
const player = players.get(draggedByPlayerId)
|
||||
if (!player) return null
|
||||
@@ -1706,6 +1709,7 @@ export function PlayingPhaseDrag() {
|
||||
isSpectating={isSpectating}
|
||||
isCorrect={isCorrect}
|
||||
draggedByPlayerId={draggedByPlayerId}
|
||||
localPlayerId={localPlayerId}
|
||||
players={players}
|
||||
viewportWidth={viewportDimensions.width}
|
||||
viewportHeight={viewportDimensions.height}
|
||||
|
||||
Reference in New Issue
Block a user