Skip to content

Commit

Permalink
Fix results page on language toggle (#1124)
Browse files Browse the repository at this point in the history
fix results page on language toggle
  • Loading branch information
alex-solo authored Dec 2, 2024
1 parent a9dc400 commit d3fe1a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pages/results/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ResultsPage = dynamic(
const Results: NextPage<{ adobeAnalyticsUrl: string }> = ({
adobeAnalyticsUrl,
}) => {
const [inputs, setInputs]: [
const [_inputs, setInputs]: [
FieldInputsObject,
(value: FieldInputsObject) => void
] = useSessionStorage('inputs', {})
Expand All @@ -43,7 +43,7 @@ const Results: NextPage<{ adobeAnalyticsUrl: string }> = ({
const [response, setResponse]: [any, (value: any) => void] =
useSessionStorage('calculationResults', {})

const [savedInputs, setSavedInputs]: [any, (value: any) => void] =
const [savedInputs, _setSavedInputs]: [any, (value: any) => void] =
useSessionStorage('resultPageInputs', {})

const inputHelper = new InputHelper(
Expand All @@ -61,6 +61,12 @@ const Results: NextPage<{ adobeAnalyticsUrl: string }> = ({
}
}, []) // eslint-disable-line react-hooks/exhaustive-deps

useEffect(() => {
const mainHandler = new MainHandler(inputHelper.asObjectWithLanguage)
const response: ResponseSuccess | ResponseError = mainHandler.results
setResponse(response)
}, [language])

return (
<>
<Head>
Expand Down

0 comments on commit d3fe1a6

Please sign in to comment.