Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Mar 1, 2023
1 parent 771c586 commit 9c93596
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Router/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
import { BLACKLISTED_PATHS } from "../Common/constants";
import { UpdateFacilityMiddleware } from "../Components/Facility/UpdateFacilityMiddleware";
import useConfig from "../Common/hooks/useConfig";
import { handleSignOut } from "../Utils/utils";

const routes = {
"/hub": () => <HubDashboard />,
Expand Down Expand Up @@ -385,6 +386,14 @@ export default function AppRouter() {
const path = usePath();
const [sidebarOpen, setSidebarOpen] = useState(false);

useEffect(() => {
addEventListener("storage", (event: any) => {
if (event.key === "care_access_token" && !event.newValue) {
handleSignOut(true);
}
});
}, []);

useEffect(() => {
setSidebarOpen(false);
let flag = false;
Expand Down

0 comments on commit 9c93596

Please sign in to comment.