From 9e55d00b4f0af8ed770abce07ce9d08ac8d1203e Mon Sep 17 00:00:00 2001 From: myCatsName <141260118+myCatsName@users.noreply.github.com> Date: Sat, 5 Aug 2023 21:48:00 -0600 Subject: [PATCH] UI: "Contract in Progress" window can no longer get lost (#716) --- src/ui/React/CodingContractModal.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/React/CodingContractModal.tsx b/src/ui/React/CodingContractModal.tsx index 529dd0c16..dc64d9d66 100644 --- a/src/ui/React/CodingContractModal.tsx +++ b/src/ui/React/CodingContractModal.tsx @@ -24,6 +24,12 @@ export function CodingContractModal(): React.ReactElement { useEffect(() => { CodingContractEvent.subscribe((props) => setContract(props)); }); + useEffect(() => { + return () => { + contract?.onClose(); + }; + }, [contract]); + if (contract === null) return <>; function onChange(event: React.ChangeEvent): void {