From ab50567068d2124e4034aee99563a560c40dc8a5 Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Fri, 30 Aug 2024 13:25:07 -0500 Subject: [PATCH] fix setting ref level --- src/features/settings/settingsSlice.js | 1 + src/pages/settings/index.js | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/features/settings/settingsSlice.js b/src/features/settings/settingsSlice.js index 9920c095..bfa5a558 100644 --- a/src/features/settings/settingsSlice.js +++ b/src/features/settings/settingsSlice.js @@ -250,6 +250,7 @@ export const selectAllTraders = createSelector([selectSettings], (settings) => { mechanic: settings[settings.gameMode].mechanic, ragman: settings[settings.gameMode].ragman, jaeger: settings[settings.gameMode].jaeger, + ref: settings[settings.gameMode].ref, }; }); diff --git a/src/pages/settings/index.js b/src/pages/settings/index.js index 4415858f..372b4d11 100644 --- a/src/pages/settings/index.js +++ b/src/pages/settings/index.js @@ -74,7 +74,7 @@ function Settings() { const hideDogtagBarters = useSelector((state) => state.settings[state.settings.gameMode].hideDogtagBarters); const gameMode = useSelector((state) => state.settings.gameMode); - const refs = { + const stationRefs = { 'bitcoin-farm': useRef(null), 'booze-generator': useRef(null), 'christmas-tree': useRef(null), @@ -104,11 +104,11 @@ function Settings() { useEffect(() => { if (useTarkovTracker) { for (const stationKey in allStations) { - if (!refs[stationKey]) { + if (!stationRefs[stationKey]) { continue; } - refs[stationKey].current?.setValue({ + stationRefs[stationKey].current?.setValue({ value: allStations[stationKey], label: allStations[stationKey] ? allStations[stationKey].toString() @@ -230,13 +230,13 @@ function Settings() {

{t('Traders')}

{traders.map((trader) => { + return ( ); })} @@ -250,7 +250,7 @@ function Settings() { label={station.name} type="station" stateKey={station.normalizedName} - ref={refs[station.normalizedName]} + ref={stationRefs[station.normalizedName]} isDisabled={useTarkovTracker} image={station.imageLink} /> @@ -265,7 +265,6 @@ function Settings() { key={skillKey} type="skill" stateKey={skillKey} - ref={refs[skillKey]} /> ); })}