Skip to content

Commit

Permalink
fix: Fixed that callback support was gone for polling in download man…
Browse files Browse the repository at this point in the history
…ager
  • Loading branch information
TriPSs committed Oct 2, 2020
1 parent 89a945e commit 1e753e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/modules/DownloadManager/DownloadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class DownloadManager extends React.Component {
*
* @returns {Promise<void>}
*/
handlePollDownload = (download) => {
handlePollDownload = (download, callback = null) => {
const { apollo } = this.props

if (this.pollingDownloads[download._id]) {
Expand All @@ -152,7 +152,12 @@ export class DownloadManager extends React.Component {
},
}).subscribe(({ data }) => {
if (data?.download) {
this.handleUpdateDownload(data?.download)
if (callback) {
callback(data?.download)

} else {
this.handleUpdateDownload(data?.download)
}
}
})
}
Expand Down

0 comments on commit 1e753e2

Please sign in to comment.