diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index aacaedb..2dbb6da 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -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(); + } }); };