um-react/src/decrypt-worker/worker.ts

13 lines
435 B
TypeScript
Raw Normal View History

import { WorkerServerBus } from '../util/WorkerEventBus';
import { DECRYPTION_WORKER_ACTION_NAME } from './constants';
const bus = new WorkerServerBus();
onmessage = bus.onmessage;
bus.addEventHandler(DECRYPTION_WORKER_ACTION_NAME.DECRYPT, async (blobURI) => {
const blob = await fetch(blobURI).then((r) => r.arrayBuffer());
// TODO: Implement decryptor for blob received here.
console.log(blob);
return { hello: true };
});