fix: raw lens renderer download option uses direct arraybuffer binary value instead of text

This commit is contained in:
Andrew Bastin
2022-03-01 02:03:30 +05:30
parent f3f9a3a226
commit e9dc7769ac
3 changed files with 39 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ export type downloadResponseReturnType = (() => void) | Ref<any>
export default function useDownloadResponse(
contentType: string,
responseBodyText: Ref<string>
responseBody: Ref<string | ArrayBuffer>
): {
downloadIcon: Ref<string>
downloadResponse: () => void
@@ -15,7 +15,7 @@ export default function useDownloadResponse(
const t = useI18n()
const downloadResponse = () => {
const dataToWrite = responseBodyText.value
const dataToWrite = responseBody.value
const file = new Blob([dataToWrite], { type: contentType })
const a = document.createElement("a")
const url = URL.createObjectURL(file)