🔍 Added Debug Logging for TCG Tags and CollaboratorFacepile
- Made gameStats calculation dynamic to show all games present - Added console logging to debug missing TCG tags - Added debug logging to CollaboratorFacepile component - Added fallback display for missing creator email - This will help identify why the facepile and tags aren't showing
This commit is contained in:
parent
34b16e972f
commit
7090adbb28
2 changed files with 30 additions and 10 deletions
|
|
@ -73,6 +73,14 @@ export default function CollaboratorFacepile({ collectionId, creatorEmail }) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log('CollaboratorFacepile render:', {
|
||||||
|
collectionId,
|
||||||
|
creatorEmail,
|
||||||
|
collaborators: collaborators.length,
|
||||||
|
allUsers: allUsers.length,
|
||||||
|
loading
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<span className="text-sm" style={{ color: 'var(--text-secondary)' }}>
|
<span className="text-sm" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
|
|
||||||
|
|
@ -299,12 +299,17 @@ export default function CollectionView() {
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
// Get game display names and counts
|
// Debug: Log the grouped cards to see what games we have
|
||||||
const gameStats = {
|
console.log('Grouped cards:', groupedCards);
|
||||||
'MTG': groupedCards['MTG']?.length || 0,
|
console.log('Available games:', Object.keys(groupedCards));
|
||||||
'Lorcana': groupedCards['Lorcana']?.length || 0,
|
|
||||||
'Pokemon': groupedCards['Pokemon']?.length || 0
|
// Get game display names and counts - make it more flexible
|
||||||
};
|
const gameStats = {};
|
||||||
|
Object.keys(groupedCards).forEach(game => {
|
||||||
|
if (game && game !== 'Other') {
|
||||||
|
gameStats[game] = groupedCards[game].length;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -393,10 +398,17 @@ export default function CollectionView() {
|
||||||
|
|
||||||
{/* Creator and Stats */}
|
{/* Creator and Stats */}
|
||||||
<div className="flex items-center space-x-6 text-sm" style={{ color: 'var(--text-secondary)' }}>
|
<div className="flex items-center space-x-6 text-sm" style={{ color: 'var(--text-secondary)' }}>
|
||||||
<CollaboratorFacepile
|
{console.log('Collection data for facepile:', { id, creator_email: collection.creator_email, collection })}
|
||||||
collectionId={id}
|
{collection.creator_email ? (
|
||||||
creatorEmail={collection.creator_email}
|
<CollaboratorFacepile
|
||||||
/>
|
collectionId={id}
|
||||||
|
creatorEmail={collection.creator_email}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<span className="text-sm" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
Crafted by Unknown User
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
<div>Cards: <span className="font-medium">{cards.length}</span></div>
|
<div>Cards: <span className="font-medium">{cards.length}</span></div>
|
||||||
<div>Cost: <span className="font-medium">${collection.totalValue || '0'}</span></div>
|
<div>Cost: <span className="font-medium">${collection.totalValue || '0'}</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue