fixing things across the board
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user