feat: split settings slice to staging (ui) and production (in effect)

This commit is contained in:
鲁树人
2023-06-10 13:10:21 +01:00
parent 865dcae931
commit f46f36415d
5 changed files with 151 additions and 117 deletions

View File

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