Skip to content

Commit

Permalink
use useSessionStorage hook
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-solo committed Nov 20, 2024
1 parent 87e21a1 commit ddd6153
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pages/results/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ const Results: NextPage<{ adobeAnalyticsUrl: string }> = ({
const language =
langx === Language.EN || langx === Language.FR ? langx : Language.EN

const response: ResponseSuccess | ResponseError = JSON.parse(
sessionStorage.getItem('calculationResults') || '{}'
)
const [response, setResponse]: [any, (value: any) => void] =
useSessionStorage('calculationResults', {})

const savedInputs = JSON.parse(
sessionStorage.getItem('resultPageInputs') || '{}'
)
const [savedInputs, setSavedInputs]: [any, (value: any) => void] =
useSessionStorage('resultPageInputs', {})

const inputHelper = new InputHelper(savedInputs.inputs, setInputs, language)

Expand Down

0 comments on commit ddd6153

Please sign in to comment.