2023-05-09 00:22:00 +00:00
|
|
|
import { WorkerServerBus } from '~/util/WorkerEventBus';
|
2023-05-08 16:36:10 +00:00
|
|
|
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 };
|
|
|
|
});
|