Skip to content

Commit 75def54

Browse files
authored
fix: Ensure privacy policy state persists properly (#24850) (#24853)
## **Description** @danjm reported that the Privacy Policy wasn't disappearing after being interacted with. The problem is that the stored setting is overidden by `initState` being spread into the arguments. ## **Related issues** Fixes: N/A ## **Manual testing steps** 1. Set `PRIVACY_POLICY_DATE` in `ui/helpers/constants/privacy-policy.ts` to today's date 2. Click to dismiss the privacy policy 3. See the privacy policy toast disappear ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24853?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 760543f commit 75def54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/scripts/controllers/app-state.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export default class AppStateController extends EventEmitter {
5252
showAccountBanner: true,
5353
trezorModel: null,
5454
currentPopupId: undefined,
55+
newPrivacyPolicyToastClickedOrClosed: null,
56+
newPrivacyPolicyToastShownDate: null,
5557
// This key is only used for checking if the user had set advancedGasFee
5658
// prior to Migration 92.3 where we split out the setting to support
5759
// multiple networks.
@@ -65,8 +67,6 @@ export default class AppStateController extends EventEmitter {
6567
'0x539': true,
6668
},
6769
surveyLinkLastClickedOrClosed: null,
68-
newPrivacyPolicyToastClickedOrClosed: null,
69-
newPrivacyPolicyToastShownDate: null,
7070
signatureSecurityAlertResponses: {},
7171
// States used for displaying the changed network toast
7272
switchedNetworkDetails: null,

0 commit comments

Comments
 (0)