feat: pass options to downstream decryptor

This commit is contained in:
鲁树人
2023-06-10 12:06:02 +01:00
parent 0038322ae9
commit 865dcae931
7 changed files with 49 additions and 16 deletions

View File

@@ -0,0 +1,11 @@
import type { DecryptCommandOptions } from '~/decrypt-worker/types';
import type { RootState } from '~/store';
import { hasOwn } from '~/util/objects';
export const selectDecryptOptionByFile = (state: RootState, name: string): DecryptCommandOptions => {
const qmc2Keys = state.settings.qmc2.keys;
return {
qmc2Key: hasOwn(qmc2Keys, name) ? qmc2Keys[name] : undefined,
};
};