From 44773e47f680ecc66cf74878dbfc36bbd2837f81 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Wed, 2 Sep 2026 01:21:58 -0500 Subject: [PATCH] Update dongle name when pressing Enter --- .../src/components/tracker/DongleSettings.tsx | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/gui/app/src/components/tracker/DongleSettings.tsx b/gui/app/src/components/tracker/DongleSettings.tsx index d715d6ca8..41ea4aa73 100644 --- a/gui/app/src/components/tracker/DongleSettings.tsx +++ b/gui/app/src/components/tracker/DongleSettings.tsx @@ -54,7 +54,9 @@ export function DongleSettingsPage() { const { dongleid } = useParams<{ dongleid: string }>(); const dongleId = dongleid ? +dongleid : undefined; - const { control, watch, reset } = useForm<{ dongleName: string }>({ + const { control, watch, reset, handleSubmit } = useForm<{ + dongleName: string; + }>({ defaultValues: { dongleName: '' }, reValidateMode: 'onSubmit', }); @@ -91,6 +93,10 @@ export function DongleSettingsPage() { sendRPCPacket(RpcMessage.ChangeDongleSettingsRequest, req); }; + const onSettingsSubmit = () => { + updateDongleSettings(); + }; + useDebouncedEffect(() => updateDongleSettings(), [dongleName], 1000); useEffect(() => { @@ -194,16 +200,21 @@ export function DongleSettingsPage() { id="dongle-settings-name_section" /> - +
+ +