mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
Fix custom name blur/reset behavior in scoreboard select
This commit is contained in:
@@ -72,23 +72,29 @@ const playerOptions = computed(() => {
|
|||||||
|
|
||||||
const leftPlayerOptions = computed(() => {
|
const leftPlayerOptions = computed(() => {
|
||||||
const options = filterOptions(playerOptions.value, leftFilter.value);
|
const options = filterOptions(playerOptions.value, leftFilter.value);
|
||||||
if (scoreboardStore.scoreboard.leftPlayerId !== CUSTOM_LEFT_PLAYER_ID) {
|
if (
|
||||||
|
scoreboardStore.scoreboard.leftPlayerId !== CUSTOM_LEFT_PLAYER_ID
|
||||||
|
|| !scoreboardStore.scoreboard.leftNameOverride.trim()
|
||||||
|
) {
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
return [{
|
return [{
|
||||||
value: CUSTOM_LEFT_PLAYER_ID,
|
value: CUSTOM_LEFT_PLAYER_ID,
|
||||||
label: scoreboardStore.scoreboard.leftNameOverride || '(Sin asignar)',
|
label: scoreboardStore.scoreboard.leftNameOverride,
|
||||||
}].concat(options);
|
}].concat(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
const rightPlayerOptions = computed(() => {
|
const rightPlayerOptions = computed(() => {
|
||||||
const options = filterOptions(playerOptions.value, rightFilter.value);
|
const options = filterOptions(playerOptions.value, rightFilter.value);
|
||||||
if (scoreboardStore.scoreboard.rightPlayerId !== CUSTOM_RIGHT_PLAYER_ID) {
|
if (
|
||||||
|
scoreboardStore.scoreboard.rightPlayerId !== CUSTOM_RIGHT_PLAYER_ID
|
||||||
|
|| !scoreboardStore.scoreboard.rightNameOverride.trim()
|
||||||
|
) {
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
return [{
|
return [{
|
||||||
value: CUSTOM_RIGHT_PLAYER_ID,
|
value: CUSTOM_RIGHT_PLAYER_ID,
|
||||||
label: scoreboardStore.scoreboard.rightNameOverride || '(Sin asignar)',
|
label: scoreboardStore.scoreboard.rightNameOverride,
|
||||||
}].concat(options);
|
}].concat(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -189,6 +195,11 @@ const onLeftFilter = (val: string, update: (fn: () => void) => void) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!val.trim() && scoreboardStore.scoreboard.leftPlayerId === CUSTOM_LEFT_PLAYER_ID) {
|
||||||
|
leftInput.value = scoreboardStore.scoreboard.leftNameOverride;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
leftInput.value = val;
|
leftInput.value = val;
|
||||||
scoreboardStore.scoreboard.leftNameOverride = val;
|
scoreboardStore.scoreboard.leftNameOverride = val;
|
||||||
if (val.trim()) {
|
if (val.trim()) {
|
||||||
@@ -205,6 +216,11 @@ const onRightFilter = (val: string, update: (fn: () => void) => void) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!val.trim() && scoreboardStore.scoreboard.rightPlayerId === CUSTOM_RIGHT_PLAYER_ID) {
|
||||||
|
rightInput.value = scoreboardStore.scoreboard.rightNameOverride;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rightInput.value = val;
|
rightInput.value = val;
|
||||||
scoreboardStore.scoreboard.rightNameOverride = val;
|
scoreboardStore.scoreboard.rightNameOverride = val;
|
||||||
if (val.trim()) {
|
if (val.trim()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user