Added additional translations.
This commit is contained in:
@@ -17,6 +17,7 @@ import { ApolloProvider } from "react-apollo";
|
||||
import { persistCache } from "apollo-cache-persist";
|
||||
import initialState from "../graphql/initial-state";
|
||||
import { shouldRefreshToken, refreshToken } from "../graphql/middleware";
|
||||
import errorLink from "../graphql/apollo-error-handling";
|
||||
|
||||
class AppContainer extends Component {
|
||||
state = {
|
||||
@@ -72,9 +73,9 @@ class AppContainer extends Component {
|
||||
const token = localStorage.getItem("token");
|
||||
// return the headers to the context so httpLink can read them
|
||||
if (token) {
|
||||
if (shouldRefreshToken) {
|
||||
refreshToken();
|
||||
}
|
||||
// if (shouldRefreshToken) {
|
||||
// refreshToken();
|
||||
// }
|
||||
|
||||
return {
|
||||
headers: {
|
||||
@@ -91,7 +92,7 @@ class AppContainer extends Component {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
middlewares.push(apolloLogger);
|
||||
}
|
||||
middlewares.push(authLink.concat(link));
|
||||
middlewares.push(errorLink.concat(authLink.concat(link)));
|
||||
|
||||
const cache = new InMemoryCache();
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ export default () => {
|
||||
localStorage.setItem("token", token);
|
||||
const now = new Date();
|
||||
window.sessionStorage.setItem(`lastTokenRefreshTime`, now);
|
||||
// window.sessionStorage.setItem("user", user);
|
||||
|
||||
apolloClient
|
||||
.mutate({
|
||||
|
||||
Reference in New Issue
Block a user