refactor(app): fold the cleaning preview bytes into addDrawing

This commit is contained in:
bchanot committed 2026-11-04 11:52:16 +01:00
1 parent bc43a1b86b
commit cfd49c7b5b
1 file changed
+5 -2
+5 -2
View File
@@ -70,8 +70,11 @@ export function composeCleaningPreview(
{ status: 'draft', document: document.value },
[],
)
const bytes = new TextEncoder().encode(drawing.stored)
const added = preview.addDrawing({ assetId, sha256: drawing.sha256, bytes })
const added = preview.addDrawing({
assetId,
sha256: drawing.sha256,
bytes: new TextEncoder().encode(drawing.stored),
})
if (added.ok)
return { ok: true, value: { preview, viewId, scope: `fv.${viewId}.` } }
preview.free()