mirror of
https://github.com/RobinLinus/snapdrop.git
synced 2025-05-17 08:00:19 -07:00
Cleanup
This commit is contained in:
parent
aa999e13c5
commit
ba69167a76
@ -481,12 +481,10 @@ class FileDigester {
|
||||
if (this._bytesReceived < this._size) return;
|
||||
// we are done
|
||||
let blob = new Blob(this._buffer, { type: this._mime });
|
||||
let url = URL.createObjectURL(blob);
|
||||
this._callback({
|
||||
name: this._name,
|
||||
mime: this._mime,
|
||||
size: this._size,
|
||||
url: url,
|
||||
blob: blob
|
||||
});
|
||||
}
|
||||
|
@ -230,7 +230,8 @@ class ReceiveDialog extends Dialog {
|
||||
|
||||
_displayFile(file) {
|
||||
const $a = this.$el.querySelector('#download');
|
||||
$a.href = file.url;
|
||||
const url = URL.createObjectURL(file.blob);
|
||||
$a.href = url;
|
||||
$a.download = file.name;
|
||||
|
||||
this.$el.querySelector('#fileName').textContent = file.name;
|
||||
@ -240,7 +241,7 @@ class ReceiveDialog extends Dialog {
|
||||
if (window.isDownloadSupported) return;
|
||||
// fallback for iOS
|
||||
$a.target = '_blank';
|
||||
let reader = new FileReader();
|
||||
const reader = new FileReader();
|
||||
reader.onload = e => $a.href = reader.result;
|
||||
reader.readAsDataURL(file.blob);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user