handle no internet connection error

This commit is contained in:
Abhinav-grd 2021-02-18 13:36:05 +05:30
parent afd3895ee3
commit 24a0f75930
3 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import React from 'react';
import UploadService from 'services/uploadService';
import { getToken } from 'utils/common/key';
import { ERR_NO_INTERNET_CONNECTION } from './CreateCollection';
import DropzoneWrapper from './DropzoneWrapper';
function CollectionDropZone({
@ -32,6 +33,8 @@ function CollectionDropZone({
if (err.response) {
setBannerErrorCode(err.response.status);
}
setBannerErrorCode(ERR_NO_INTERNET_CONNECTION);
setProgressView(false);
}
};
return (

View file

@ -6,6 +6,8 @@ import { CollectionAndItsLatestFile } from 'services/collectionService';
import { getToken } from 'utils/common/key';
import constants from 'utils/strings/constants';
export const ERR_NO_INTERNET_CONNECTION = 0;
export default function CreateCollection(props) {
const {
acceptedFiles,
@ -76,6 +78,8 @@ export default function CreateCollection(props) {
if (err.response) {
setBannerErrorCode(err.response.status);
}
setBannerErrorCode(ERR_NO_INTERNET_CONNECTION);
setProgressView(false);
}
};
return (

View file

@ -82,6 +82,8 @@ const englishConstants = {
ZOOM_IN_OUT: 'Zoom in/out',
PREVIOUS: 'Previous (arrow left)',
NEXT: 'Next (arrow right)',
NO_INTERNET_CONNECTION:
'You seem to be offline please check your internet connection and try again',
};
export default englishConstants;