Code responsible for showing/hiding modal with policy acceptance. Currently, only with Terms of Use & Privacy because it's the only police we have right now.
Details
- Reviewers
tomek atul - Commits
- rCOMM9ea15e542e53: [web] policy acknowledgment handler
- Log in to web app
- Change confirmed field for logged user in policy table
- Modal should appear (not immediately but after any request will be sent to keyserver)
- I accept should close modal and update value on keyserver db
- User should not be able to close modal using any method
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
web/redux/policy-acknowledgment-handler.js | ||
---|---|---|
12 ↗ | (On Diff #19184) | Maybe rename this |
12 ↗ | (On Diff #19184) | It would be great if we could avoid duplicating the state. Now we're tracking it here and also in modal context - policyModalPushed is true if and only if the context contains TermsAndPrivacyModal. Maybe we can somehow use that state instead? (it might be challenging though) |
13 ↗ | (On Diff #19184) | Does it sound better? |
19–22 ↗ | (On Diff #19184) | Could you explain why we're hiding the modal in this case? Does !tosAndPrivacyState mean that we don't have to accept anything? |
web/redux/policy-acknowledgment-handler.js | ||
---|---|---|
13 ↗ | (On Diff #19184) | We're only using needPolicyAcceptance?.[policyTypes.tosAndPrivacyPolicy] so we can make this more efficient by returning exactly this from selector. By doing that we can avoid unnecessary renders. |
web/redux/policy-acknowledgment-handler.js | ||
---|---|---|
12 ↗ | (On Diff #19184) | Done |
19–22 ↗ | (On Diff #19184) | I was thinking about a situation when we have no information in store about policies (that's why !tosAndPrivacyState - which is not the same as !isAcknowledged) and somehow modal is visible but it looks like this is not a possible case so removing those lines |