mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
17 lines
306 B
TypeScript
17 lines
306 B
TypeScript
/**
|
|
* @prettier
|
|
*/
|
|
export const saveURLAsFile = ({
|
|
filename,
|
|
url,
|
|
document,
|
|
}: {
|
|
filename: string;
|
|
url: string;
|
|
document: Document;
|
|
}): void => {
|
|
const anchorElement = document.createElement('a');
|
|
anchorElement.href = url;
|
|
anchorElement.download = filename;
|
|
anchorElement.click();
|
|
};
|