From 2781720146f6a93b9c6f29d4b33c2e78c60746c3 Mon Sep 17 00:00:00 2001 From: Conni243 Date: Tue, 11 Jul 2023 20:17:01 +0200 Subject: [PATCH 1/2] Fixed pfp's not showing up in scoreboard --- src/components/TF2/Player/Player.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TF2/Player/Player.tsx b/src/components/TF2/Player/Player.tsx index 83133e5..05f4248 100644 --- a/src/components/TF2/Player/Player.tsx +++ b/src/components/TF2/Player/Player.tsx @@ -80,7 +80,7 @@ const Player = ({ player, icon, pfp, className }: Player) => { width={24} height={24} src={ - pfp ?? + player.steamInfo?.pfp ?? 'https://cdn.discordapp.com/icons/1112665618869661726/d6a0255dfca479cbde6707908fbc9a2a.webp' } alt="Profile" From d5734d903adf55140ef8018083f5ad187708ffb8 Mon Sep 17 00:00:00 2001 From: Sammy Date: Tue, 11 Jul 2023 20:33:39 +0200 Subject: [PATCH 2/2] remove residue, minor refactor --- src/components/TF2/Player/Player.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/TF2/Player/Player.tsx b/src/components/TF2/Player/Player.tsx index 05f4248..7e4eea5 100644 --- a/src/components/TF2/Player/Player.tsx +++ b/src/components/TF2/Player/Player.tsx @@ -53,17 +53,18 @@ function displayProperStatus(status: string) { interface Player { player: PlayerInfo; icon?: string; - pfp?: string; className?: string; } -const Player = ({ player, icon, pfp, className }: Player) => { +const Player = ({ player, icon, className }: Player) => { // Use "Player" as a verdict if the client isnt You const displayVerdict = player.isSelf ? 'You' : displayProperVerdict(player.verdict ?? 'Player'); const displayTime = formatTime(player.gameInfo?.time!); const displayStatus = displayProperStatus(player.gameInfo!.state!); + const pfp = player.steamInfo?.pfp ?? + 'https://cdn.discordapp.com/icons/1112665618869661726/d6a0255dfca479cbde6707908fbc9a2a.webp' return ( @@ -79,10 +80,7 @@ const Player = ({ player, icon, pfp, className }: Player) => { className="player-pfp" width={24} height={24} - src={ - player.steamInfo?.pfp ?? - 'https://cdn.discordapp.com/icons/1112665618869661726/d6a0255dfca479cbde6707908fbc9a2a.webp' - } + src={pfp} alt="Profile" />
{player.name}