Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix results page on language toggle #1124

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading