Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 11, 2024
1 parent a152913 commit 633e401
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
22 changes: 21 additions & 1 deletion packages/@uppy/companion-client/src/RequestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import pRetry, { AbortError } from 'p-retry'

import fetchWithNetworkError from '@uppy/utils/lib/fetchWithNetworkError'
import ErrorWithCause from '@uppy/utils/lib/ErrorWithCause'
import emitSocketProgress from '@uppy/utils/lib/emitSocketProgress'
import getSocketHost from '@uppy/utils/lib/getSocketHost'

import type Uppy from '@uppy/core'
Expand Down Expand Up @@ -81,6 +80,27 @@ async function handleJSONResponse<ResJson>(res: Response): Promise<ResJson> {
throw new HttpError({ statusCode: res.status, message: errMsg })
}

function emitSocketProgress(
uploader: { uppy: Uppy<any, any> },
progressData: {
progress: string // pre-formatted percentage number as a string
bytesTotal: number
bytesUploaded: number
},
file: UppyFile<any, any>,
): void {
const { progress, bytesUploaded, bytesTotal } = progressData
if (progress) {
uploader.uppy.log(`Upload progress: ${progress}`)
uploader.uppy.emit('upload-progress', file, {
uploadStarted: file.progress.uploadStarted ?? 0,
bytesUploaded,
bytesTotal,
})
}
}


export default class RequestClient<M extends Meta, B extends Body> {
static VERSION = packageJson.version

Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"./lib/dataURItoBlob": "./lib/dataURItoBlob.js",
"./lib/dataURItoFile": "./lib/dataURItoFile.js",
"./lib/emaFilter": "./lib/emaFilter.js",
"./lib/emitSocketProgress": "./lib/emitSocketProgress.js",
"./lib/findAllDOMElements": "./lib/findAllDOMElements.js",
"./lib/findDOMElement": "./lib/findDOMElement.js",
"./lib/generateFileID": "./lib/generateFileID.js",
Expand Down
24 changes: 0 additions & 24 deletions packages/@uppy/utils/src/emitSocketProgress.ts

This file was deleted.

0 comments on commit 633e401

Please sign in to comment.