Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

it was already revoking

Manav Rathi08346e5bcdec
diff --git a/web/packages/base/utils/web.ts b/web/packages/base/utils/web.ts
index f51583ae11..cb45280990 100644
--- a/web/packages/base/utils/web.ts
+++ b/web/packages/base/utils/web.ts
@@ -3,11 +3,12 @@
* folder by appending a temporary <a> element to the DOM.
*
* @param url The URL that we want to download. See also
- * {@link downloadAndRevokeObjectURL} and {@link downloadString}.
+ * {@link downloadAndRevokeObjectURL} and {@link downloadString}. The URL is
+ * revoked after initiating the download.
*
* @param fileName The name of downloaded file.
*/
-export const downloadURL = (url: string, fileName: string) => {
+export const downloadAndRevokeObjectURL = (url: string, fileName: string) => {
const a = document.createElement("a");
a.style.display = "none";
a.href = url;
@@ -18,15 +19,6 @@ export const downloadURL = (url: string, fileName: string) => {
a.remove();
};
-/**
- * A variant of {@link downloadURL} that also revokes the provided
- * {@link objectURL} after initiating the download.
- */
-export const downloadAndRevokeObjectURL = (url: string, fileName: string) => {
- downloadURL(url, fileName);
- URL.revokeObjectURL(url);
-};
-
/**
* Save the given string {@link s} as a file in the user's download folder.
*