add polling

This commit is contained in:
afazio1
2024-04-22 01:39:25 -04:00
parent ddbc977c01
commit 7467092e0f
2 changed files with 35 additions and 1 deletions

View File

@@ -3,11 +3,12 @@ import { Link, useNavigate } from 'react-router-dom';
import { Outlet } from "react-router-dom";
import { SessionContext, destroySessionCookie, getSessionCookie } from "./contexts/session";
import { useState, useEffect, useContext } from "react";
import { usePoll } from "./hooks/usePoll";
export default function App() {
const [session, setSession] = useState(getSessionCookie());
const navigate = useNavigate();
usePoll();
// Redirect to login if session is undefined
useEffect(
() => {