mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-25 01:06:17 -04:00
rename function and add event to achieve compatibility with snapdrop-android app
This commit is contained in:
parent
4a0cd1f49a
commit
17abc91c86
2 changed files with 10 additions and 4 deletions
|
@ -340,7 +340,7 @@ class Peer {
|
|||
this._onFilesTransferRequest(messageJSON);
|
||||
break;
|
||||
case 'header':
|
||||
this._onFilesHeader(messageJSON);
|
||||
this._onFileHeader(messageJSON);
|
||||
break;
|
||||
case 'partition':
|
||||
this._onReceivedPartitionEnd(messageJSON);
|
||||
|
@ -400,7 +400,7 @@ class Peer {
|
|||
this._requestPending = null;
|
||||
}
|
||||
|
||||
_onFilesHeader(header) {
|
||||
_onFileHeader(header) {
|
||||
if (this._requestAccepted && this._requestAccepted.header.length) {
|
||||
this._lastProgress = 0;
|
||||
this._digester = new FileDigester({size: header.size, name: header.name, mime: header.mime},
|
||||
|
@ -454,6 +454,9 @@ class Peer {
|
|||
this._abortTransfer();
|
||||
}
|
||||
|
||||
// include for compatibility with Snapdrop for Android app
|
||||
Events.fire('file-received', fileBlob);
|
||||
|
||||
this._filesReceived.push(fileBlob);
|
||||
if (!this._requestAccepted.header.length) {
|
||||
this._busy = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue