Skip to content

Commit 6aa66d9

Browse files
Add feature flag
1 parent b9bc7d9 commit 6aa66d9

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
@@ -10281,6 +10281,9 @@ describe('SnapController', () => {
1028110281
snaps: getPersistedSnapsState(mockSnap),
1028210282
},
1028310283
fetchFunction,
10284+
featureFlags: {
10285+
autoUpdatePreinstalledSnaps: true,
10286+
},
1028410287
}),
1028510288
);
1028610289

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,12 @@ type FeatureFlags = {
716716
* any production builds (including beta and Flask).
717717
*/
718718
forcePreinstalledSnaps?: boolean;
719+
720+
/**
721+
* Automatically update preinstalled Snaps "over the air",
722+
* when a new version of the Snap is added to the registry.
723+
*/
724+
autoUpdatePreinstalledSnaps?: boolean;
719725
};
720726

721727
type DynamicFeatureFlags = {
@@ -1491,6 +1497,10 @@ export class SnapController extends BaseController<
14911497
}),
14921498
);
14931499

1500+
if (!this.#featureFlags.autoUpdatePreinstalledSnaps) {
1501+
return;
1502+
}
1503+
14941504
const preinstalledVersionRange = '*' as SemVerRange;
14951505

14961506
await Promise.allSettled(

0 commit comments

Comments
 (0)