handle no internet connection error
This commit is contained in:
parent
afd3895ee3
commit
24a0f75930
3 changed files with 9 additions and 0 deletions
|
@ -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 (
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue