From e9dcfb9bd0a5e387387dc3015a34876ca95809a1 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Mon, 10 Jan 2022 13:39:58 -0600 Subject: [PATCH] Update job page in real time --- src/Locations/ui/CompanyLocation.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Locations/ui/CompanyLocation.tsx b/src/Locations/ui/CompanyLocation.tsx index f9d3ee96f..04fee9754 100644 --- a/src/Locations/ui/CompanyLocation.tsx +++ b/src/Locations/ui/CompanyLocation.tsx @@ -3,7 +3,7 @@ * * This subcomponent renders all of the buttons for applying to jobs at a company */ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; import Tooltip from "@mui/material/Tooltip"; @@ -36,6 +36,11 @@ export function CompanyLocation(props: IProps): React.ReactElement { function rerender(): void { setRerender((old) => !old); } + + useEffect(() => { + const id = setInterval(rerender, 200); + return () => clearInterval(id); + }, []); /** * We'll keep a reference to the Company that this component is being rendered for, * so we don't have to look it up every time