-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update STX Banner Alert, include
chainSupportsSmartTransactions
(
#29911) - Added selectors for chain support and preference enabled - Updated alertConditions to include chain support and preference enabled checks The banner will now only show if the chain supports smart transactions and they are enabled in preferences. ## **Description** 1. Reason for change: The Smart Transactions banner was showing incorrectly for users who had STX enabled before migration. The banner should only show for users when STX is newly enabled by the migration. 2. Improvement/solution: Modified migration script to only set `smartTransactionsMigrationApplied` when STX is newly enabled during migration, rather than setting it for all migrated users. This ensures the banner's display logic correctly identifies users who need to see the STX announcement. ## **Related issues** Fixes: #[issue number] ## **Manual testing steps** 1. Install older version of MetaMask with STX enabled 2. Upgrade to version with these changes 3. Verify banner does not show for pre-enabled STX users 4. Install older version with STX disabled 5. Upgrade to version with these changes 6. Verify banner shows when migration enables STX ## **Screenshots/Recordings** Load old version 12.5.0 and turn STX OFF, go through migration and ensure that: - STX is now ON - Banner Alert shows only on STX supported chains https://github.com/user-attachments/assets/f85da8e9-5e4f-46eb-9132-95a8129a4f4e Load old version 12.5.0 and turn STX ON, go through migration and ensure that: - STX is still ON - Banner Alert does not show https://github.com/user-attachments/assets/0bff702c-a24d-4d52-b6a3-2d9615589fd5 ### **Before** Banner shows for all users after migration, even those who had STX previously enabled. ### **After** Banner only shows for users where migration newly enabled STX. ## **Pre-merge author checklist** - [x] I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards - [x] I've completed the PR template to the best of my ability - [x] I've included tests: - Updated migration tests to verify new behavior - Updated component tests to work with new migration logic - Fixed existing integration tests - [x] I've documented my code using JSDoc format where applicable - [x] I've applied the right labels on the PR ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR - [x] I confirm that this PR addresses all acceptance criteria and includes necessary testing evidence --------- Co-authored-by: Ramon Acitores <[email protected]>
- Loading branch information
1 parent
fcfd96f
commit 564c825
Showing
9 changed files
with
149 additions
and
39 deletions.
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
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
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
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
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