Skip to content

Commit

Permalink
test: try dynamic import again
Browse files Browse the repository at this point in the history
  • Loading branch information
yapyuyou committed Mar 18, 2024
1 parent 1735cd0 commit 29fb45c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/renderer/SvgRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ export const SvgRenderer: FunctionComponent<SvgRendererProps> = ({
try {
const response = await fetch(svgOrUrl);
const blob = await response.blob();

Check warning on line 53 in src/components/renderer/SvgRenderer.tsx

View workflow job for this annotation

GitHub Actions / Test

'blob' is assigned a value but never used
setBuffer(await blob.arrayBuffer());
let shaDigest;
const svgUint8Array = new Uint8Array(buffer ?? []);
import("multiformats/hashes/sha2").then(({ sha256 }) => {
shaDigest = sha256.digest(svgUint8Array) as Promise<Digest<18, number>>;
shaDigest.then((res: any) => {
console.log("sha result is ", res);
});
});
// setBuffer(await blob.arrayBuffer());
} catch (error) {
setIsError(true);
}
Expand Down

0 comments on commit 29fb45c

Please sign in to comment.