Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/apps/services/api/drafts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.',
{
Expand Down