From b458eeedd27b27bfa91795872a2b4366d53ba0c7 Mon Sep 17 00:00:00 2001 From: Araozu Date: Wed, 30 Aug 2023 16:02:32 -0500 Subject: [PATCH] [FE][Certs] Refresh register list on add --- frontend/src/certs/Registers/index.tsx | 5 ++++- frontend/src/certs/index.tsx | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/certs/Registers/index.tsx b/frontend/src/certs/Registers/index.tsx index ce757eb..60d563f 100644 --- a/frontend/src/certs/Registers/index.tsx +++ b/frontend/src/certs/Registers/index.tsx @@ -5,10 +5,13 @@ import { Register } from "../../types/Register"; import { courseMap } from "../../utils/allCourses"; import { certGenerator } from "../../certGenerator"; -export function Registers(props: {person: Person | null}) { +export function Registers(props: {person: Person | null, count: number}) { const [registers, setRegisters] = createSignal>([]); createEffect(async() => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _count = props.count; + if (props.person === null) { setRegisters([]); return; diff --git a/frontend/src/certs/index.tsx b/frontend/src/certs/index.tsx index f867b0b..4ada58c 100644 --- a/frontend/src/certs/index.tsx +++ b/frontend/src/certs/index.tsx @@ -6,12 +6,16 @@ import { Person } from "../types/Person"; export function Certs() { const [person, setPerson] = createSignal(null); + const [count, setCount] = createSignal(0); return (
- {}} /> - + setCount((x) => x + 1)} + /> +
); }