refactor: switch to using downloadSmallObject

This commit is contained in:
Derrick Hammer 2023-08-10 03:12:10 -04:00
parent 87eebe7427
commit 1b654c9a60
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,11 @@ import {
objAsString,
sha512,
} from "@lumeweb/libkernel";
import { deriveChildKey, downloadObject, verifyCid } from "@lumeweb/libweb";
import {
deriveChildKey,
downloadSmallObject,
verifyCid,
} from "@lumeweb/libweb";
import type { moduleQuery, presentKeyData } from "@lumeweb/libkernel/module";
import { readableStreamToUint8Array } from "binconv";
@ -462,7 +466,7 @@ function handleModuleCall(
// TODO: Check localStorage for the module.
// Download the code for the worker.
const [moduleData, errDS] = await downloadObject(finalModule);
const [moduleData, errDS] = await downloadSmallObject(finalModule);
if (errDS !== null) {
const err = addContextToErr(errDS, "unable to load module");
respondErr(event, messagePortal, isWorker, err);