diff --git a/src/store/stores/inputs.ts b/src/store/stores/inputs.ts index 6a706933..6a4ce1e7 100644 --- a/src/store/stores/inputs.ts +++ b/src/store/stores/inputs.ts @@ -16,7 +16,6 @@ const STORE_NAME = 'Inputs'; const sliceConfigs: SliceConfigs = { userValues: { initialValue: {}, - canAddSingleItem: true, singleItem: { type: {} as UserValue }, }, previewContent: { diff --git a/src/store/stores/status.ts b/src/store/stores/status.ts index dd01c2e6..cb52e866 100644 --- a/src/store/stores/status.ts +++ b/src/store/stores/status.ts @@ -23,7 +23,6 @@ const sliceConfigs: SliceConfigs = { statusMessages: { initialValue: [], singleItem: { type: {} }, - canAddSingleItem: true, }, }; diff --git a/src/store/utils/createStoreFactory.ts b/src/store/utils/createStoreFactory.ts index 6f3311f8..7a67d3d4 100644 --- a/src/store/utils/createStoreFactory.ts +++ b/src/store/utils/createStoreFactory.ts @@ -6,7 +6,6 @@ type SliceConfig = { singleItem?: { type: SingleItemType; }; - canAddSingleItem?: boolean; }; export type SliceConfigs = Record; @@ -24,14 +23,14 @@ export function createStoreFactory(configs: T, storeN const storeCreator: StateCreatorTyped = (set, get, api) => Object.entries(configs).reduce( - (acc, [key, { initialValue, canAddSingleItem }]) => ({ + (acc, [key, { initialValue, singleItem }]) => ({ ...acc, ...createBaseSlice( { basic: key as keyof T & string, }, initialValue, - canAddSingleItem, + !!singleItem, )(set as any, get as any, api as any), }), {} as State,