vikunja-frontend/src/helpers/downloadBlob.ts

7 lines
213 B
TypeScript
Raw Normal View History

export const downloadBlob = (url: string, filename: string) => {
const link = document.createElement('a')
link.href = url
link.setAttribute('download', filename)
link.click()
window.URL.revokeObjectURL(url)
}