Skip to content

Commit 633e401

Browse files
committed
fix build error
1 parent a152913 commit 633e401

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

packages/@uppy/companion-client/src/RequestClient.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import pRetry, { AbortError } from 'p-retry'
44

55
import fetchWithNetworkError from '@uppy/utils/lib/fetchWithNetworkError'
66
import ErrorWithCause from '@uppy/utils/lib/ErrorWithCause'
7-
import emitSocketProgress from '@uppy/utils/lib/emitSocketProgress'
87
import getSocketHost from '@uppy/utils/lib/getSocketHost'
98

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

83+
function emitSocketProgress(
84+
uploader: { uppy: Uppy<any, any> },
85+
progressData: {
86+
progress: string // pre-formatted percentage number as a string
87+
bytesTotal: number
88+
bytesUploaded: number
89+
},
90+
file: UppyFile<any, any>,
91+
): void {
92+
const { progress, bytesUploaded, bytesTotal } = progressData
93+
if (progress) {
94+
uploader.uppy.log(`Upload progress: ${progress}`)
95+
uploader.uppy.emit('upload-progress', file, {
96+
uploadStarted: file.progress.uploadStarted ?? 0,
97+
bytesUploaded,
98+
bytesTotal,
99+
})
100+
}
101+
}
102+
103+
84104
export default class RequestClient<M extends Meta, B extends Body> {
85105
static VERSION = packageJson.version
86106

packages/@uppy/utils/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"./lib/dataURItoBlob": "./lib/dataURItoBlob.js",
2828
"./lib/dataURItoFile": "./lib/dataURItoFile.js",
2929
"./lib/emaFilter": "./lib/emaFilter.js",
30-
"./lib/emitSocketProgress": "./lib/emitSocketProgress.js",
3130
"./lib/findAllDOMElements": "./lib/findAllDOMElements.js",
3231
"./lib/findDOMElement": "./lib/findDOMElement.js",
3332
"./lib/generateFileID": "./lib/generateFileID.js",

packages/@uppy/utils/src/emitSocketProgress.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)