Skip to content

Commit 227beb1

Browse files
release(runway): cherry-pick fix: do not start subscription-polling when shield feature is disabled cp-13.8.0 (#37487)
- fix: do not start subscription-polling when shield feature is disabled cp-13.8.0 (#37476) <!-- 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** fix: do not start subscription-polling when shield feature is disabled <!-- 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/37476?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fixed subscription-polling when shield feature is disabled ## **Related issues** Fixes: #37485 ## **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** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Only start Shield subscription polling when the feature and basic functionality are enabled, alongside existing account/sign-in/unlock checks. > > - **Shield subscription context (`ui/contexts/shield/shield-subscription.tsx`)**: > - Tighten polling start condition to require `isMetaMaskShieldFeatureEnabled` and `isBasicFunctionalityEnabled` in addition to `selectedAccount`, `isSignedIn`, and `isUnlocked`. > - Update `useEffect` dependency array to include `isMetaMaskShieldFeatureEnabled` and `isBasicFunctionalityEnabled`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1db862f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [f3f9bcf](f3f9bcf) Co-authored-by: Lwin <[email protected]>
1 parent 1e3653a commit 227beb1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

ui/contexts/shield/shield-subscription.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,24 @@ export const ShieldSubscriptionProvider: React.FC = ({ children }) => {
127127
]);
128128

129129
useEffect(() => {
130-
if (selectedAccount && isSignedIn && isUnlocked) {
130+
if (
131+
isMetaMaskShieldFeatureEnabled &&
132+
isBasicFunctionalityEnabled &&
133+
selectedAccount &&
134+
isSignedIn &&
135+
isUnlocked
136+
) {
131137
// start polling for the subscriptions
132138
dispatch(subscriptionsStartPolling());
133139
}
134-
}, [isSignedIn, selectedAccount, dispatch, isUnlocked]);
140+
}, [
141+
isMetaMaskShieldFeatureEnabled,
142+
isSignedIn,
143+
selectedAccount,
144+
dispatch,
145+
isUnlocked,
146+
isBasicFunctionalityEnabled,
147+
]);
135148

136149
const resetShieldEntryModalShownStatus = useCallback(() => {
137150
if (!isShieldSubscriptionActive) {

0 commit comments

Comments
 (0)