-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Update identity reset UI (Make consistent with EX) #29701
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
Conversation
5ca414f
to
fec5e88
Compare
0edccfe
to
dab78ad
Compare
dab78ad
to
8f0073e
Compare
8f0073e
to
f3035e1
Compare
f3035e1
to
94c7056
Compare
94c7056
to
4fdc53e
Compare
4fdc53e
to
fff5732
Compare
fff5732
to
eccb05c
Compare
onBeforeClose: async (reason): Promise<boolean> => { | ||
// This is the only time that we can detect that the dialog | ||
// is being closed due to the user clicking on the | ||
// background. | ||
if (reason === "backgroundClick") { | ||
// The user clicked away - go back a step | ||
store.returnAfterReset(); | ||
} | ||
return true; | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notwithstanding my comments about getting rid of returnAfterReset
, there is an easier way to do this.
- Have
ResetIdentityDialog
'sonFinished
prop take an optional booleansuccess
argument. Where we run that callback fromonResetWrapper
, set the argument totrue
. - Use the
finished
promise returned bycreateDialog
to figure out if we successfully did the reset:const handle = Modal.createDialog( ResetIdentityDialog, /* props= */ { variant: "confirm", }, ); handle.finished.then(([success]) => { if (success) { // The user completed the reset process - close this dialog this.props.onFinished(); store.done(); } else { // The user clicked away - go back a step store.returnAfterReset(); } });
b337923
to
8cd0cd1
Compare
8cd0cd1
to
4fdebb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks basically fine now but I think there's a bit of cruft left that we can clean up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more suggestions which might help make this clearer. The Modal
API is unintuitive and very poorly documented 😢
81b0ba4
to
0041bbf
Compare
Fixes #29227
This adds
IdentityResetDialog
, which wrapsIdentityResetBody
in a dialog, and launches it fromSetupEncryptionBody
, instead of doing the reset directly there. In the new flow, only the user's cryptographic identity is reset -- recovery is no longer set up at the same time.This is mostly work by @uhoreg , rebased and refactored a bit here.
I recommend reviewing commit-by-commit.