Skip to content

Commit d834e29

Browse files
committed
πŸ› Fix png endpoint
png endpoint was throwing an error about initWasm multiple times
1 parent 6db06b3 commit d834e29

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

β€Ž.changeset/poor-olives-arrive.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'socialify': patch
3+
---
4+
5+
Fix png endpoint

β€Žcommon/renderPNG.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import resvgWasm from '../public/resvg_bg.wasm?module'
55
import renderCardSVG from './renderSVG'
66
import QueryType from './types/queryType'
77

8+
const initResvgWasm = resvg.initWasm(resvgWasm)
9+
810
const renderCardPNG = async (query: QueryType) => {
9-
const [svg] = await Promise.all([
10-
renderCardSVG(query),
11-
resvg.initWasm(resvgWasm)
12-
])
11+
const [svg] = await Promise.all([renderCardSVG(query), initResvgWasm])
1312

1413
const resvgJS = new resvg.Resvg(svg, {
1514
fitTo: {

0 commit comments

Comments
Β (0)