Skip to content

Commit d7767b0

Browse files
Add feature flag
1 parent 341a308 commit d7767b0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/snaps-controllers/src/snaps/SnapController.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10203,6 +10203,9 @@ describe('SnapController', () => {
1020310203
snaps: getPersistedSnapsState(mockSnap),
1020410204
},
1020510205
fetchFunction,
10206+
featureFlags: {
10207+
autoUpdatePreinstalledSnaps: true,
10208+
},
1020610209
}),
1020710210
);
1020810211

packages/snaps-controllers/src/snaps/SnapController.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,12 @@ type FeatureFlags = {
713713
* any production builds (including beta and Flask).
714714
*/
715715
forcePreinstalledSnaps?: boolean;
716+
717+
/**
718+
* Automatically update preinstalled Snaps "over the air",
719+
* when a new version of the Snap is added to the registry.
720+
*/
721+
autoUpdatePreinstalledSnaps?: boolean;
716722
};
717723

718724
type DynamicFeatureFlags = {
@@ -1488,6 +1494,10 @@ export class SnapController extends BaseController<
14881494
}),
14891495
);
14901496

1497+
if (!this.#featureFlags.autoUpdatePreinstalledSnaps) {
1498+
return;
1499+
}
1500+
14911501
const preinstalledVersionRange = '*' as SemVerRange;
14921502

14931503
await Promise.allSettled(

0 commit comments

Comments
 (0)