Merge pull request #2536 from nickofolas/realtime-company

Update job page in real time
This commit is contained in:
hydroflame 2022-01-10 14:51:50 -05:00 committed by GitHub
commit f742782e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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