Corregir override libre y limpiar team/country al escribir jugador nuevo

This commit is contained in:
Pandipipas
2026-02-11 01:15:59 +01:00
parent 8581237838
commit 7e3f0853cd
@@ -135,19 +135,50 @@ const rightHasSelectedPlayerChanges = computed(() => {
const leftPlayerOptions = computed(() => filterOptions(playerOptions.value, leftFilter.value));
const rightPlayerOptions = computed(() => filterOptions(playerOptions.value, rightFilter.value));
const startLeftCustomPlayer = () => {
scoreboardStore.scoreboard.leftPlayerId = '';
scoreboardStore.scoreboard.leftTeamOverride = '';
scoreboardStore.scoreboard.leftCountryOverride = '';
};
const startRightCustomPlayer = () => {
scoreboardStore.scoreboard.rightPlayerId = '';
scoreboardStore.scoreboard.rightTeamOverride = '';
scoreboardStore.scoreboard.rightCountryOverride = '';
};
const onLeftFilter = (val: string, update: (fn: () => void) => void) => {
update(() => {
leftFilter.value = val;
if (!leftFocused.value) {
return;
}
leftInput.value = val;
scoreboardStore.scoreboard.leftNameOverride = val;
if (val.trim()) {
startLeftCustomPlayer();
}
});
};
const onRightFilter = (val: string, update: (fn: () => void) => void) => {
update(() => {
rightFilter.value = val;
if (!rightFocused.value) {
return;
}
rightInput.value = val;
scoreboardStore.scoreboard.rightNameOverride = val;
if (val.trim()) {
startRightCustomPlayer();
}
});
};