Added better error boundary page. Started some CSS and layout refactoring. **Major Changes**.
This commit is contained in:
@@ -10,7 +10,7 @@ import { RetryLink } from "apollo-link-retry";
|
||||
import { WebSocketLink } from "apollo-link-ws";
|
||||
import { getMainDefinition } from "apollo-utilities";
|
||||
import LogRocket from "logrocket";
|
||||
import React, { Component } from "react";
|
||||
import React from "react";
|
||||
import GlobalLoadingBar from "../components/global-loading-bar/global-loading-bar.component";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
import errorLink from "../graphql/apollo-error-handling";
|
||||
@@ -28,7 +28,6 @@ const wsLink = new WebSocketLink({
|
||||
lazy: true,
|
||||
reconnect: true,
|
||||
connectionParams: async () => {
|
||||
//const token = localStorage.getItem("token");
|
||||
const token =
|
||||
auth.currentUser && (await auth.currentUser.getIdToken(true));
|
||||
if (token) {
|
||||
@@ -110,26 +109,18 @@ if (process.env.NODE_ENV === "development") {
|
||||
middlewares.push(retryLink.concat(errorLink.concat(authLink.concat(link))));
|
||||
|
||||
const cache = new InMemoryCache();
|
||||
|
||||
export const client = new ApolloClient({
|
||||
link: ApolloLink.from(middlewares),
|
||||
cache,
|
||||
connectToDevTools: true,
|
||||
connectToDevTools: process.env.NODE_ENV !== "production",
|
||||
});
|
||||
|
||||
export default class AppContainer extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = { client };
|
||||
}
|
||||
|
||||
render() {
|
||||
const { client } = this.state;
|
||||
|
||||
return (
|
||||
<ApolloProvider client={client}>
|
||||
<GlobalLoadingBar />
|
||||
<App />
|
||||
</ApolloProvider>
|
||||
);
|
||||
}
|
||||
export default function AppContainer() {
|
||||
return (
|
||||
<ApolloProvider client={client}>
|
||||
<GlobalLoadingBar />
|
||||
<App />
|
||||
</ApolloProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user