mirror of
https://github.com/RobinLinus/snapdrop.git
synced 2025-05-18 08:30:09 -07:00
iOS: More fallback tests
This commit is contained in:
parent
508b5e22f9
commit
bc2956f5ad
@ -480,13 +480,14 @@ class FileDigester {
|
||||
this.progress = this._bytesReceived / this._size;
|
||||
if (this._bytesReceived < this._size) return;
|
||||
// we are done
|
||||
let received = new Blob(this._buffer, { type: this._mime });
|
||||
let url = URL.createObjectURL(received);
|
||||
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
|
||||
url: url,
|
||||
blob: blob
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,13 @@ class ReceiveDialog extends Dialog {
|
||||
this.show();
|
||||
|
||||
if (window.isDownloadSupported) return;
|
||||
$a.target = "_blank"; // fallback
|
||||
// fallback for iOS
|
||||
$a.href = null;
|
||||
let reader = new FileReader();
|
||||
reader.onload = e => {
|
||||
$a.onclick = window.open(reader.result,'_blank');
|
||||
}
|
||||
reader.readAsDataURL(file.blob);
|
||||
}
|
||||
|
||||
_formatFileSize(bytes) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user