(chunk)
| 186 | } |
| 187 | |
| 188 | _onChunkReceived(chunk) { |
| 189 | if(!chunk.byteLength) return; |
| 190 | |
| 191 | this._digester.unchunk(chunk); |
| 192 | const progress = this._digester.progress; |
| 193 | this._onDownloadProgress(progress); |
| 194 | |
| 195 | // occasionally notify sender about our progress |
| 196 | if (progress - this._lastProgress < 0.01) return; |
| 197 | this._lastProgress = progress; |
| 198 | this._sendProgress(progress); |
| 199 | } |
| 200 | |
| 201 | _onDownloadProgress(progress) { |
| 202 | Events.fire('file-progress', { sender: this._peerId, progress: progress }); |
no test coverage detected