From b6c77febac295ead16c9feb1f30d5ee2ae9876a4 Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Tue, 28 Mar 2023 18:26:01 +0700 Subject: [PATCH] fix(#444): fix lexics in playerstab --- src/features/LexicsStore/helpers/index.tsx | 5 +---- src/features/LexicsStore/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/features/LexicsStore/helpers/index.tsx b/src/features/LexicsStore/helpers/index.tsx index d60282f2..e0b82477 100644 --- a/src/features/LexicsStore/helpers/index.tsx +++ b/src/features/LexicsStore/helpers/index.tsx @@ -54,10 +54,7 @@ export const mapTranslationsToLocalKeys = ( export const getLexicFromSport = () => { const sportList = getLocalStorageItem(querieKeys.sportsList) const sportLexics = Object.values(sportList as Array) - .reduce((acc:LexicsConfig, cur: Sport) => { - acc[cur?.lexic] = cur?.lexic - return acc - }, {}) + .map((sport) => sport.lexic) return sportLexics } diff --git a/src/features/LexicsStore/index.tsx b/src/features/LexicsStore/index.tsx index d760b63c..3769a4db 100644 --- a/src/features/LexicsStore/index.tsx +++ b/src/features/LexicsStore/index.tsx @@ -30,6 +30,7 @@ export const useLexicsConfig = (config: Array | LexicsConfig) => { const { addLexicsConfig } = useLexicsStore() useEffect(() => { - addLexicsConfig({ ...config, ...getLexicFromSport() }) + addLexicsConfig(config) + addLexicsConfig(getLexicFromSport()) }, [addLexicsConfig, config]) }