diff --git a/desktop/flipper-common/src/settings.tsx b/desktop/flipper-common/src/settings.tsx index de730cc13..9568d7680 100644 --- a/desktop/flipper-common/src/settings.tsx +++ b/desktop/flipper-common/src/settings.tsx @@ -77,7 +77,7 @@ export type LauncherSettings = { }; // Settings that primarily only apply to Electron atm -// TODO: further separte between flipper-ui config and Electron config +// TODO: further separate between flipper-ui config and Electron config export type ProcessConfig = { disabledPlugins: string[]; lastWindowPosition: { @@ -90,6 +90,7 @@ export type ProcessConfig = { launcherMsg: string | null; // Controls whether to delegate to the launcher if present. launcherEnabled: boolean; + updaterEnabled: boolean; // Control whether to suppress "update available" notifications suppressPluginUpdateNotifications?: boolean; }; diff --git a/desktop/flipper-server-core/src/utils/__tests__/processConfig.node.tsx b/desktop/flipper-server-core/src/utils/__tests__/processConfig.node.tsx index 0f41b8865..5e4a3d0f4 100644 --- a/desktop/flipper-server-core/src/utils/__tests__/processConfig.node.tsx +++ b/desktop/flipper-server-core/src/utils/__tests__/processConfig.node.tsx @@ -18,6 +18,7 @@ test('config is decoded from env', () => { screenCapturePath: '/my/screenshot/path', launcherEnabled: false, suppressPluginUpdateNotifications: true, + updaterEnabled: true, }), }); @@ -28,6 +29,7 @@ test('config is decoded from env', () => { screenCapturePath: '/my/screenshot/path', launcherEnabled: false, suppressPluginUpdateNotifications: true, + updaterEnabled: true, }); }); @@ -39,5 +41,6 @@ test('config is decoded from env with defaults', () => { screenCapturePath: undefined, launcherEnabled: true, suppressPluginUpdateNotifications: false, + updaterEnabled: true, }); }); diff --git a/desktop/flipper-server-core/src/utils/processConfig.tsx b/desktop/flipper-server-core/src/utils/processConfig.tsx index 547be1755..a71904453 100644 --- a/desktop/flipper-server-core/src/utils/processConfig.tsx +++ b/desktop/flipper-server-core/src/utils/processConfig.tsx @@ -18,6 +18,8 @@ export function loadProcessConfig(env: NodeJS.ProcessEnv): ProcessConfig { screenCapturePath: json.screenCapturePath, launcherEnabled: typeof json.launcherEnabled === 'boolean' ? json.launcherEnabled : true, + updaterEnabled: + typeof json.updaterEnabled === 'boolean' ? json.updaterEnabled : true, suppressPluginUpdateNotifications: typeof json.suppressPluginUpdateNotifications === 'boolean' ? json.suppressPluginUpdateNotifications diff --git a/desktop/flipper-ui-core/src/chrome/UpdateIndicator.tsx b/desktop/flipper-ui-core/src/chrome/UpdateIndicator.tsx index caf69eb71..cebab7698 100644 --- a/desktop/flipper-ui-core/src/chrome/UpdateIndicator.tsx +++ b/desktop/flipper-ui-core/src/chrome/UpdateIndicator.tsx @@ -85,6 +85,7 @@ export default function UpdateIndicator() { } } else if ( version && + config.updaterEnabled && !config.suppressPluginUpdateNotifications && isProduction() ) { diff --git a/desktop/flipper-ui-core/src/dispatcher/handleOpenPluginDeeplink.tsx b/desktop/flipper-ui-core/src/dispatcher/handleOpenPluginDeeplink.tsx index 50f420686..efa2ae416 100644 --- a/desktop/flipper-ui-core/src/dispatcher/handleOpenPluginDeeplink.tsx +++ b/desktop/flipper-ui-core/src/dispatcher/handleOpenPluginDeeplink.tsx @@ -284,7 +284,12 @@ async function waitForLogin(store: Store) { async function verifyFlipperIsUpToDate(title: string) { const config = getRenderHostInstance().serverConfig.processConfig; - if (!isProduction() || isTest() || config.suppressPluginUpdateNotifications) { + if ( + !isProduction() || + isTest() || + !config.updaterEnabled || + config.suppressPluginUpdateNotifications + ) { return; } const currentVersion = getAppVersion(); diff --git a/desktop/scripts/jest-setup-after.tsx b/desktop/scripts/jest-setup-after.tsx index 313e9ce92..1fd69331f 100644 --- a/desktop/scripts/jest-setup-after.tsx +++ b/desktop/scripts/jest-setup-after.tsx @@ -137,6 +137,7 @@ function createStubRenderHost(): RenderHost { launcherEnabled: false, launcherMsg: null, screenCapturePath: `/dev/null`, + updaterEnabled: true, suppressPluginUpdateNotifications: false, }, settings: {