mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
Corregir override libre y limpiar team/country al escribir jugador nuevo
This commit is contained in:
@@ -135,19 +135,50 @@ const rightHasSelectedPlayerChanges = computed(() => {
|
|||||||
const leftPlayerOptions = computed(() => filterOptions(playerOptions.value, leftFilter.value));
|
const leftPlayerOptions = computed(() => filterOptions(playerOptions.value, leftFilter.value));
|
||||||
const rightPlayerOptions = computed(() => filterOptions(playerOptions.value, rightFilter.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) => {
|
const onLeftFilter = (val: string, update: (fn: () => void) => void) => {
|
||||||
update(() => {
|
update(() => {
|
||||||
leftFilter.value = val;
|
leftFilter.value = val;
|
||||||
|
|
||||||
|
if (!leftFocused.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
leftInput.value = val;
|
leftInput.value = val;
|
||||||
scoreboardStore.scoreboard.leftNameOverride = val;
|
scoreboardStore.scoreboard.leftNameOverride = val;
|
||||||
|
|
||||||
|
if (val.trim()) {
|
||||||
|
startLeftCustomPlayer();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRightFilter = (val: string, update: (fn: () => void) => void) => {
|
const onRightFilter = (val: string, update: (fn: () => void) => void) => {
|
||||||
update(() => {
|
update(() => {
|
||||||
rightFilter.value = val;
|
rightFilter.value = val;
|
||||||
|
|
||||||
|
if (!rightFocused.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rightInput.value = val;
|
rightInput.value = val;
|
||||||
scoreboardStore.scoreboard.rightNameOverride = val;
|
scoreboardStore.scoreboard.rightNameOverride = val;
|
||||||
|
|
||||||
|
if (val.trim()) {
|
||||||
|
startRightCustomPlayer();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user