Additional fixes for firebase login. Capture basic local state.
This commit is contained in:
@@ -6,13 +6,14 @@ import ApolloClient from "apollo-client";
|
||||
import { InMemoryCache } from "apollo-cache-inmemory";
|
||||
import { resolvers, typeDefs } from "../graphql/resolvers";
|
||||
import initialState from "../graphql/initial-state";
|
||||
import { gql } from "apollo-boost";
|
||||
//Styling imports
|
||||
import "./App.css";
|
||||
|
||||
//Component Imports
|
||||
import SignIn from "../components/landing-components/sign-in/sign-in.component";
|
||||
import LandingPage from "../pages/landing/landing.component";
|
||||
import Manage from "../pages/manage/manage.component";
|
||||
import SignIn from "../components/sign-in-form/sign-in-form.component";
|
||||
import LandingPage from "../pages/landing/landing.page";
|
||||
import Manage from "../pages/manage/manage.page";
|
||||
|
||||
import PrivateRoute from "../utils/private-route";
|
||||
|
||||
@@ -31,8 +32,17 @@ export default function App({ authState }) {
|
||||
resolvers,
|
||||
typeDefs
|
||||
});
|
||||
|
||||
//Init local state.
|
||||
client.writeData({
|
||||
data: { ...initialState, authState }
|
||||
data: {
|
||||
...initialState,
|
||||
currentUser: {
|
||||
__typename: null,
|
||||
email: authState.user.email,
|
||||
displayName: authState.user.displayName
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user