diff --git a/src/apps/services/api/drafts.ts b/src/apps/services/api/drafts.ts index d5ff3c0f..0ced1d8f 100644 --- a/src/apps/services/api/drafts.ts +++ b/src/apps/services/api/drafts.ts @@ -11,6 +11,7 @@ import { DraftSubmission, ProgressListener } from '../../types/submissions' import generateOneBlinkUploader from '../generateOneBlinkUploader' import { OneBlinkStorageError } from '@oneblink/storage' import generateOneBlinkDownloader from '../generateOneBlinkDownloader' +import { isOffline } from '../../offline-service' async function uploadDraftData( draftSubmission: DraftSubmission, @@ -269,6 +270,16 @@ async function downloadDraftData( } } + if (isOffline()) { + throw new OneBlinkAppsError( + 'You are currently offline and do not have a local copy of this draft available, please connect to the internet and try again', + { + originalError: error instanceof Error ? error : undefined, + isOffline: true, + }, + ) + } + throw new OneBlinkAppsError( 'An unknown error has occurred. Please contact support if the problem persists.', {