Skip to content

Commit

Permalink
fix(web): infinite loop on network error (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaWaite authored Jun 28, 2023
1 parent 05e32d1 commit fa30bc5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions web/src/services/gql/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { ReactNode } from "react";
import { reportError } from "@reearth/sentry";
import { useAuth } from "@reearth/services/auth";
import { e2eAccessToken } from "@reearth/services/config";
import { useError } from "@reearth/services/state";

import fragmentMatcher from "./fragmentMatcher.json";

Expand Down Expand Up @@ -51,7 +50,6 @@ const Provider: React.FC<{ children?: ReactNode }> = ({ children }) => {
const endpoint = window.REEARTH_CONFIG?.api
? `${window.REEARTH_CONFIG.api}/graphql`
: "/api/graphql";
const [, setError] = useError();
const { getAccessToken } = useAuth();

const authLink = setContext(async (_, { headers }) => {
Expand Down Expand Up @@ -83,7 +81,6 @@ const Provider: React.FC<{ children?: ReactNode }> = ({ children }) => {
};
}
if (error) {
setError(error);
reportError(error);
}
});
Expand Down

0 comments on commit fa30bc5

Please sign in to comment.