Fixed selected nav item. Added lazy loading for WS client to resolve token issue. Added some filtering to jobs list.
This commit is contained in:
@@ -13,20 +13,17 @@ import SignInPage from "../pages/sign-in/sign-in.page";
|
||||
import Unauthorized from "../pages/unauthorized/unauthorized.component";
|
||||
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
|
||||
import { UPSERT_USER } from "../graphql/user.queries";
|
||||
import { GET_CURRENT_USER } from "../graphql/local.queries";
|
||||
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
||||
import AlertComponent from "../components/alert/alert.component";
|
||||
import SignOut from "../components/sign-out/sign-out.component";
|
||||
|
||||
import { UPSERT_USER } from "../graphql/user.queries";
|
||||
|
||||
export default () => {
|
||||
const apolloClient = useApolloClient();
|
||||
|
||||
useEffect(() => {
|
||||
//Run the auth code only on the first render.
|
||||
const unsubscribeFromAuth = auth.onAuthStateChanged(async user => {
|
||||
const unsubscribeFromAuth = auth.onIdTokenChanged(async user => {
|
||||
if (user) {
|
||||
let token;
|
||||
token = await user.getIdToken();
|
||||
@@ -85,7 +82,6 @@ export default () => {
|
||||
return <AlertComponent message={HookCurrentUser.error.message} />;
|
||||
return (
|
||||
<div>
|
||||
<SignOut />
|
||||
<Switch>
|
||||
<Route exact path="/" component={LandingPage} />
|
||||
<Route exact path="/unauthorized" component={Unauthorized} />
|
||||
|
||||
Reference in New Issue
Block a user