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

Prevent user from accidentally triggering multiple identity resets #29388

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

uhoreg
Copy link
Member

@uhoreg uhoreg commented Feb 27, 2025

Part of #29192

When the user clicks the Continue button to reset their identity, show a spinner, disable the button, and warn them not to close the window.

image

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

@uhoreg
Copy link
Member Author

uhoreg commented Feb 28, 2025

I have a question in the linked issue about the wording on the button, but this should otherwise be ready for initial review.

@uhoreg uhoreg marked this pull request as ready for review February 28, 2025 01:02
@uhoreg uhoreg requested review from a team as code owners February 28, 2025 01:02
Comment on lines 36 to 39
let resolveResetEncryption;
const resetEncryptionPromise: Promise<void> = new Promise((resolve) => {
resolveResetEncryption = resolve;
});
Copy link
Member

Choose a reason for hiding this comment

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

We can use defer here instead

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Which is built-in, better to use t3chguy option

Copy link
Member Author

Choose a reason for hiding this comment

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

When I try to use withResolvers, TypeScript complains, saying that I need to set "the 'lib' compiler option to 'es2024' or later", which I'm not sure if it is something I should do. So I'll use defer for now.

</Button>
{inProgress ? (
<EncryptionCardEmphasisedContent>
<span className="text-warning">
Copy link
Member

Choose a reason for hiding this comment

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

Can we use compound variable here instead of global test-warning which is relying on $alert

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I don't know understand exactly what you mean here. Should I be creating a new style and use var(--cpd-color-text-critical-primary)? Or is there a different class or element that I should be using?

Copy link
Member

@richvdh richvdh Mar 3, 2025

Choose a reason for hiding this comment

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

8f9d93c creates a new CSS class which uses the compound variable -- hopefully that is what was intended.

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

Successfully merging this pull request may close these issues.

5 participants