From 85812378389a1d0fbcc30d13b8d642dc4c9ceeff Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:10:07 +0100 Subject: [PATCH] =?UTF-8?q?Corregir=20selecci=C3=B3n=20libre=20de=20jugado?= =?UTF-8?q?r=20en=20ScoreboardPanel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/components/ScoreboardPanel.vue | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index dff0135..aacaedb 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -187,18 +187,28 @@ const applyRightPlayerData = (playerId: string) => { rightCountryInput.value = getCountryLabel(scoreboardStore.scoreboard.rightCountryOverride); }; -const onLeftSelect = () => { +const onLeftSelect = (playerId: string) => { + const hasExistingPlayer = Boolean(playerId && playersStore.players[playerId]); + if (!hasExistingPlayer) { + return; + } + scoreboardStore.scoreboard.leftNameOverride = ''; leftFilter.value = ''; - leftInput.value = getPlayerLabel(scoreboardStore.scoreboard.leftPlayerId); - applyLeftPlayerData(scoreboardStore.scoreboard.leftPlayerId); + leftInput.value = getPlayerLabel(playerId); + applyLeftPlayerData(playerId); }; -const onRightSelect = () => { +const onRightSelect = (playerId: string) => { + const hasExistingPlayer = Boolean(playerId && playersStore.players[playerId]); + if (!hasExistingPlayer) { + return; + } + scoreboardStore.scoreboard.rightNameOverride = ''; rightFilter.value = ''; - rightInput.value = getPlayerLabel(scoreboardStore.scoreboard.rightPlayerId); - applyRightPlayerData(scoreboardStore.scoreboard.rightPlayerId); + rightInput.value = getPlayerLabel(playerId); + applyRightPlayerData(playerId); }; const createPlayerId = (name: string) => {