From c78dbf479f04ad9f04400bc57954a104bd3c82ca Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 7 Oct 2023 11:14:05 -0500 Subject: [PATCH] [FE] Fixes #7 - Set tab title to the current person name --- frontend/index.html | 2 +- frontend/src/certs/Search/index.tsx | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 135da56..7615021 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,7 +5,7 @@ - EEGSAC - internal tool + EEGSAC - Sistema interno diff --git a/frontend/src/certs/Search/index.tsx b/frontend/src/certs/Search/index.tsx index fd5050e..4af2720 100644 --- a/frontend/src/certs/Search/index.tsx +++ b/frontend/src/certs/Search/index.tsx @@ -24,6 +24,15 @@ export function Search(props: {setPerson: (p: Person | null) => void}) { const [person, setPerson] = createSignal(null); const [manualCreate, setManualCreate] = createSignal(false); + // Change tab title + createEffect(() => { + if (person() === null) { + document.title = "EEGSAC - Sistema interno"; + } else { + document.title = `${person()!.person_names} ${person()!.person_paternal_surname} ${person()!.person_maternal_surname}`; + } + }); + // Update QR and automatically search when DNI is changed createEffect(() => { const dniT = dni(); @@ -61,7 +70,7 @@ export function Search(props: {setPerson: (p: Person | null) => void}) { setPerson(response.data.Ok); props.setPerson(response.data.Ok); } else { - setError(response.data.Err.reason); + setError(response.data.Error.reason); setManualCreate(false); } })