MCPcopy Index your code
hub / github.com/SnapDrop/snapdrop / unchunk

Method unchunk

client/scripts/network.js:488–504  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

486 }
487
488 unchunk(chunk) {
489 this._buffer.push(chunk);
490 this._bytesReceived += chunk.byteLength || chunk.size;
491 const totalChunks = this._buffer.length;
492 this.progress = this._bytesReceived / this._size;
493 if (isNaN(this.progress)) this.progress = 1
494
495 if (this._bytesReceived < this._size) return;
496 // we are done
497 let blob = new Blob(this._buffer, { type: this._mime });
498 this._callback({
499 name: this._name,
500 mime: this._mime,
501 size: this._size,
502 blob: blob
503 });
504 }
505
506}
507

Callers 1

_onChunkReceivedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected