muffin-admin 3.14.1 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dataprovider.js +5 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/dataprovider.ts +4 -1
package/package.json
CHANGED
package/src/dataprovider.ts
CHANGED
|
@@ -96,7 +96,10 @@ export function MuffinDataprovider(apiUrl: string) {
|
|
|
96
96
|
const url = window.URL.createObjectURL(await response.blob())
|
|
97
97
|
const link = document.createElement("a")
|
|
98
98
|
link.href = url
|
|
99
|
-
|
|
99
|
+
const filename =
|
|
100
|
+
response.headers.get("content-disposition")?.split("filename=")[1] || path.split("/").pop()
|
|
101
|
+
link.setAttribute("download", filename)
|
|
102
|
+
if (filename) link.setAttribute("download", filename)
|
|
100
103
|
link.click()
|
|
101
104
|
// no need to append link as child to body.
|
|
102
105
|
setTimeout(() => window.URL.revokeObjectURL(url), 0) // this is important too, otherwise we will be unnecessarily spiking memory!
|