fix(backend-proxy): fix SVGs are not shown (#4206)
This commit is contained in:
parent
f43c8d8648
commit
7e950a2ef4
@ -10,6 +10,7 @@ import {
|
|||||||
APIError,
|
APIError,
|
||||||
unsentRequest,
|
unsentRequest,
|
||||||
UnpublishedEntry,
|
UnpublishedEntry,
|
||||||
|
blobToFileObj,
|
||||||
} from 'netlify-cms-lib-util';
|
} from 'netlify-cms-lib-util';
|
||||||
import AuthenticationPage from './AuthenticationPage';
|
import AuthenticationPage from './AuthenticationPage';
|
||||||
|
|
||||||
@ -38,7 +39,8 @@ const deserializeMediaFile = ({ id, content, encoding, path, name }: MediaFile)
|
|||||||
byteArray[i] = decodedContent.charCodeAt(i);
|
byteArray[i] = decodedContent.charCodeAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const file = new File([byteArray], name);
|
const blob = new Blob([byteArray]);
|
||||||
|
const file = blobToFileObj(name, blob);
|
||||||
const url = URL.createObjectURL(file);
|
const url = URL.createObjectURL(file);
|
||||||
return { id, name, path, file, size: file.size, url, displayURL: url };
|
return { id, name, path, file, size: file.size, url, displayURL: url };
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user