|
@@ -230,7 +230,8 @@ class ReceiveDialog extends Dialog {
|
|
|
|
|
|
_displayFile(file) {
|
|
_displayFile(file) {
|
|
const $a = this.$el.querySelector('#download');
|
|
const $a = this.$el.querySelector('#download');
|
|
- $a.href = file.url;
|
|
|
|
|
|
+ const url = URL.createObjectURL(file.blob);
|
|
|
|
+ $a.href = url;
|
|
$a.download = file.name;
|
|
$a.download = file.name;
|
|
|
|
|
|
this.$el.querySelector('#fileName').textContent = file.name;
|
|
this.$el.querySelector('#fileName').textContent = file.name;
|
|
@@ -238,7 +239,11 @@ class ReceiveDialog extends Dialog {
|
|
this.show();
|
|
this.show();
|
|
|
|
|
|
if (window.isDownloadSupported) return;
|
|
if (window.isDownloadSupported) return;
|
|
- // $a.target = "_blank"; // fallback
|
|
|
|
|
|
+ // fallback for iOS
|
|
|
|
+ $a.target = '_blank';
|
|
|
|
+ const reader = new FileReader();
|
|
|
|
+ reader.onload = e => $a.href = reader.result;
|
|
|
|
+ reader.readAsDataURL(file.blob);
|
|
}
|
|
}
|
|
|
|
|
|
_formatFileSize(bytes) {
|
|
_formatFileSize(bytes) {
|