diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 2dbb6da..76adba2 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -151,34 +151,12 @@ const startRightCustomPlayer = () => { 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(); - } }); }; @@ -327,6 +305,35 @@ const saveRightSelectedPlayerChanges = () => { scoreboardStore.scoreboard.rightNameOverride = ''; }; + +watch( + leftInput, + (value) => { + if (!leftFocused.value) { + return; + } + + scoreboardStore.scoreboard.leftNameOverride = value; + if (value.trim()) { + startLeftCustomPlayer(); + } + }, +); + +watch( + rightInput, + (value) => { + if (!rightFocused.value) { + return; + } + + scoreboardStore.scoreboard.rightNameOverride = value; + if (value.trim()) { + startRightCustomPlayer(); + } + }, +); + watch( () => scoreboardStore.scoreboard.leftPlayerId, (playerId) => {