fixing things across the board

This commit is contained in:
talksik
2022-03-18 10:03:57 -04:00
parent 9613e2b2cf
commit 3488278d2d
10 changed files with 95 additions and 52 deletions
@@ -13,17 +13,15 @@ export default function ProtectedRoute({
const { isLoading, isError } = useGetUserDetails();
const navigate = useNavigate();
useEffect(() => {
if (isError) {
navigate("/login");
}
}, [isError]);
useEffect(() => {
// console.log(window.electronAPI.store.get(STORE_ITEMS.AUTH_TOKENS));
// nirvanaApi.getUserDetails();
}, []);
if (isError) {
navigate("/login");
}
if (isLoading) return <span>please wait while we authenticate you</span>;
// if we can successfully get user details, we are good to continue