This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
Patch: "Reloading the registration page should warn about data loss" #8377
Merged
Merged
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ac39d61
warn of data loss on reloading registration page
yaya-usman 3c47141
update: warn on loss of data on refresh
yaya-usman e37af06
Merge branch 'develop' of https://github.com/yaya-usman/matrix-react-…
yaya-usman 2c9712b
update: unloadCallback made private
yaya-usman b29c417
proper event annotation
yaya-usman 872d0e0
resolve conflict
yaya-usman 9fe77a8
update: popup the dialog warning at a later stage of registration
yaya-usman 8b0dca2
updated branch
yaya-usman 9b92c90
show warn dialog only at a later stage of registration
yaya-usman 48636c6
Merge branch 'develop' of https://github.com/yaya-usman/matrix-react-…
yaya-usman 584d54e
updated fix
yaya-usman 8ed065f
resolve conflict
yaya-usman 75c3627
updated warn dialog logic
yaya-usman 71e9932
Merge branch 'develop' of https://github.com/yaya-usman/matrix-react-…
yaya-usman 736eae1
updated fix
yaya-usman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 component can be used outside the context of registration, lets please not scope creep
This component already also renders CaptchaForm so two listeners will be active when the captcha form is active
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.
Sorry, it's not working if i only placed the listener in one of the other, so i had to place it in both, i believe they are seperate confirmation entity. you can check to confirm on your browser
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.
It should be possible to keep the listener in a single location in the Registration component, and then add and remove it on the fly as registration moves through the different stages using
componentDidUpdate
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.
I am not sure i really understand this clearly, as requested by @t3chguy the warning should only be available at a later stage of the registration which is fine but according to your suggestion now, is it possible to actually detect if it has moved from one stage to another since all the stages are just having one route
/register
?.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.
Yes, the Registration component holds state that determines which stage of the registration process the user is on, so we should be able to detect in that component when the user has moved past the first stage
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.
I need a bit of your help here, currently the state variable i think keeps track of the stages is
flow
which is an array of object containing a property namedstages
which is also an array,the issue here is that i tried using componentDidUpdate and log to the console to check if there is a state change btwn previous and current so i can leverage on that but unfortunately there isn't, also immediately i hit the register button, it stops logging the current and prev values and rather logs the following instead, which i couldn't find anywhere in the projectThis is when it still logs the curr and prev:
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.
Also lastly, in my opinion including the listeners in both components as i have done previously doesn't hurt atall because throughout the entire application it's only the Auth section that makes use of this components, even if it were to be used by another component, it still serves it's purpose of not allowing user refresh without warning them of a data loss.
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.
Nonetheless, i'll appreciate if you guys can point me in the right direction.
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.
I think just conditioning on
this.state.doingUIAuth
should be fineAuth yes, but not Registration. The issue was about Registration, not changing password/deleting devices/deactivating account which can all also run the UIA code. Ideally lets keep to the issue to not scope creep
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.
Ok boss, thanks... Will try to work things out as you have suggested.