lbry-desktop/ui/util/downloadClaim.js

14 lines
412 B
JavaScript
Raw Normal View History

export function webDownloadClaim(streamingUrl, fileName) {
// @if TARGET='web'
let element = document.createElement('a');
element.setAttribute('href', `${streamingUrl}?download=true`);
element.setAttribute('download', fileName);
element.style.display = 'none';
// $FlowFixMe
document.body.appendChild(element);
element.click();
// $FlowFixMe
document.body.removeChild(element);
// @endif
}