mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-08 15:10:54 +03:00
moved decodeURIComponent to fileReceiver
This commit is contained in:
@@ -65,7 +65,7 @@ $(document).ready(function() {
|
|||||||
return;
|
return;
|
||||||
})
|
})
|
||||||
.then(([decrypted, fname]) => {
|
.then(([decrypted, fname]) => {
|
||||||
name.innerText = decodeURIComponent(fname);
|
name.innerText = fname;
|
||||||
const dataView = new DataView(decrypted);
|
const dataView = new DataView(decrypted);
|
||||||
const blob = new Blob([dataView]);
|
const blob = new Blob([dataView]);
|
||||||
const downloadUrl = URL.createObjectURL(blob);
|
const downloadUrl = URL.createObjectURL(blob);
|
||||||
@@ -74,10 +74,10 @@ $(document).ready(function() {
|
|||||||
a.href = downloadUrl;
|
a.href = downloadUrl;
|
||||||
if (window.navigator.msSaveBlob) {
|
if (window.navigator.msSaveBlob) {
|
||||||
// if we are in microsoft edge or IE
|
// if we are in microsoft edge or IE
|
||||||
window.navigator.msSaveBlob(blob, decodeURIComponent(fname));
|
window.navigator.msSaveBlob(blob, fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
a.download = decodeURIComponent(fname);
|
a.download = fname;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class FileReceiver extends EventEmitter {
|
|||||||
resolve(decrypted);
|
resolve(decrypted);
|
||||||
}),
|
}),
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
resolve(fname);
|
resolve(decodeURIComponent(fname));
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user