mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
Corregir selección libre de jugador en ScoreboardPanel
This commit is contained in:
@@ -187,18 +187,28 @@ const applyRightPlayerData = (playerId: string) => {
|
|||||||
rightCountryInput.value = getCountryLabel(scoreboardStore.scoreboard.rightCountryOverride);
|
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 = '';
|
scoreboardStore.scoreboard.leftNameOverride = '';
|
||||||
leftFilter.value = '';
|
leftFilter.value = '';
|
||||||
leftInput.value = getPlayerLabel(scoreboardStore.scoreboard.leftPlayerId);
|
leftInput.value = getPlayerLabel(playerId);
|
||||||
applyLeftPlayerData(scoreboardStore.scoreboard.leftPlayerId);
|
applyLeftPlayerData(playerId);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRightSelect = () => {
|
const onRightSelect = (playerId: string) => {
|
||||||
|
const hasExistingPlayer = Boolean(playerId && playersStore.players[playerId]);
|
||||||
|
if (!hasExistingPlayer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
scoreboardStore.scoreboard.rightNameOverride = '';
|
scoreboardStore.scoreboard.rightNameOverride = '';
|
||||||
rightFilter.value = '';
|
rightFilter.value = '';
|
||||||
rightInput.value = getPlayerLabel(scoreboardStore.scoreboard.rightPlayerId);
|
rightInput.value = getPlayerLabel(playerId);
|
||||||
applyRightPlayerData(scoreboardStore.scoreboard.rightPlayerId);
|
applyRightPlayerData(playerId);
|
||||||
};
|
};
|
||||||
|
|
||||||
const createPlayerId = (name: string) => {
|
const createPlayerId = (name: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user