feat(storage): Pass over config to worker thread on decryption call

(cherry picked from commit 36d616398eac4e8d51863863fa5205fe1c91267f)
This commit is contained in:
鲁树人
2021-12-20 22:22:35 +00:00
parent d8b362efbe
commit eaf457e6a0
2 changed files with 10 additions and 2 deletions

View File

@@ -39,6 +39,7 @@
import { spawn, Worker, Pool } from 'threads';
import { CommonDecrypt } from '@/decrypt/common.ts';
import { DecryptQueue } from '@/utils/utils';
import { storage } from '@/utils/storage';
export default {
name: 'FileSelector',
@@ -76,7 +77,7 @@ export default {
this.queue.queue(async (dec = CommonDecrypt) => {
console.log('start handling', file.name);
try {
this.$emit('success', await dec(file));
this.$emit('success', await dec(file, await storage.getAll()));
} catch (e) {
console.error(e);
this.$emit('error', e, file.name);