Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TXL-435): turn smart transactions on by default for new users (#…
…27885) ## **Description** This PR: * enables smart transactions by default for new users * prevents the smart transaction opt-in modal from appearing To enable stx by default, we needed to replace the `getSmartTransactionsOptInStatus` selector with two distinct selectors: - `getSmartTransactionsOptInStatusForMetrics` - `getSmartTransactionsPreferenceEnabled` Previously, the `getSmartTransactionsOptInStatus` selector was doing double duty for the user's opt-in status and deciding whether the preference was enabled. Since the feature was disabled by default, and a user that has not opted-in or out of smart transactions has an opt-in status of null, this did not pose a problem. However, since we decided to enable smart transactions by default, we needed a separate selector for checking the preference for deciding to enable stx. ### Why not keep the `getSmartTransactionsOptInStatus` selector as-is and just add a new one? We considered keeping the `getSmartTransactionsOptInStatus` selector and adding a new one. However, by renaming it to `getSmartTransactionsOptInStatusForMetrics`, we avoid any confusion and make it clear that it is used for metrics collection and not for user preference handling. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27885?quickstart=1) ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TXL-435 ## **Manual testing steps** 1. add an account with funds on mainnet 2. opt-in modal does not display 3. transfer 0ETH to yourself uses smart transaction 4. preferences toggle starts enabled 5. set preferences toggle off 6. transfer 0ETH to yourself uses regular transaction ## **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 Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension 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.
- Loading branch information