All files / client/src/components KompassiLogoutCallback.tsx

80% Statements 4/5
100% Branches 0/0
100% Functions 2/2
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16            356x 6x   6x 6x          
import { ReactElement, useEffect } from "react";
import { Navigate } from "react-router";
import { submitLogout } from "client/views/logout/logoutActions";
import { useAppDispatch } from "client/utils/hooks";
import { AppRoute } from "client/app/AppRoutes";
 
export const KompassiLogoutCallback = (): ReactElement => {
  const dispatch = useAppDispatch();
 
  useEffect(() => {
    dispatch(submitLogout());
  });
 
  return <Navigate to={AppRoute.ROOT} replace />;
};