refactor(app): fold the cleaning preview bytes into addDrawing
This commit is contained in:
1 parent
bc43a1b86b
commit
cfd49c7b5b
1 file changed
+5
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user