Skip to content

Commit

Permalink
add dialog/toast for networkError (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubh152 authored Dec 23, 2023
1 parent 269a3f0 commit 5fe81f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
REACT_APP_BACKEND_WEBSOCKET_URL,
} from 'Constant/constant';
import { refreshToken } from 'utils/getRefreshToken';
import { toast } from 'react-toastify';

const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => {
Expand All @@ -55,6 +56,12 @@ const errorLink = onError(
});
} else if (networkError) {
console.log(`[Network error]: ${networkError}`);
toast.error(
'API server unavailable. Check your connection or try again later',
{
toastId: 'apiServer',
}
);
}
}
);
Expand Down

0 comments on commit 5fe81f0

Please sign in to comment.