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

GEN-670 - fix: change ssn warning dialog glitch #2794

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

guilhermespopolin
Copy link
Contributor

@guilhermespopolin guilhermespopolin commented Jul 17, 2023

Describe your changes

  • Updates condition for the appearance of ChangeSsnWarningDialog

Justify why they are needed

As it can be seen in the video below, the glitch happens because ChangeSsnWarningDialog get's shown for a brief moment when we load information for an authenticated user. In those situations we need to display BankId Dialog but ChangeSsnWarningDialog also get's show because:

  • ChangeSsnWarningDialog appearance is based on the presence of shopsSession.customer?.ssn.
  • In that scenario the active section is still ssn; It will be the next one only when Bankid Dialog get's resolved, which makes sense I think. That also means SsnSeSection will be re-rendered but this time shopsSession.customer will be present - causing the appearance of ChangeSsnWarningDialog.;

I think what we want in this case is a more imperative solution where we get to decide when to showChangeSsnWarningDialog - when "Edit" button get's clicked and we already have a loaded customer.

Screen.Recording.2023-07-18.at.10.15.47.mov

@vercel
Copy link

vercel bot commented Jul 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hedvig-dot-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2023 2:06pm
onboarding ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2023 2:06pm

@guilhermespopolin
Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@notion-workspace
Copy link

datadogLogs.logger.info('Cleared shopSession to change SSN in price calculator')

const url = new URL(window.location.href)
if (!url.searchParams.has(OPEN_PRICE_CALCULATOR_QUERY_PARAM)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solves one issue we're currently having where that query param might be added several times.

Copy link
Contributor

@alebedev alebedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup, I don't have any more questions

apps/store/src/components/PriceCalculator/SsnSeSection.tsx Outdated Show resolved Hide resolved
url.searchParams.append(OPEN_PRICE_CALCULATOR_QUERY_PARAM, '1')
}

await router.replace(url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just do a hard page reload here or are we sure this works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants