From 0cf28344a647344938a558a27fbf0a471e358a5b Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Wed, 26 Jan 2022 12:17:46 -0800 Subject: [PATCH] Enable background throttling for alpha users --- app/main.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/main.ts b/app/main.ts index f609d402ea..7289134426 100644 --- a/app/main.ts +++ b/app/main.ts @@ -73,7 +73,7 @@ import { createTemplate } from './menu'; import { installFileHandler, installWebHandler } from './protocol_filter'; import * as OS from '../ts/OS'; import { createBrowserWindow } from '../ts/util/createBrowserWindow'; -import { isProduction } from '../ts/util/version'; +import { isProduction, isAlpha } from '../ts/util/version'; import { isSgnlHref, isCaptchaHref, @@ -117,6 +117,8 @@ const development = getEnvironment() === Environment.Development || getEnvironment() === Environment.Staging; +const isThrottlingEnabled = development || isAlpha(app.getVersion()); + const enableCI = config.get('enableCI'); const preventDisplaySleepService = new PreventDisplaySleepService( @@ -479,10 +481,7 @@ async function createWindow() { ), nativeWindowOpen: true, spellcheck: await getSpellCheckSetting(), - // We are evaluating background throttling in development. If we decide to - // move forward, we can remove this line (as `backgroundThrottling` is true by - // default). - backgroundThrottling: development, + backgroundThrottling: isThrottlingEnabled, enablePreferredSizeMode: true, }, icon: windowIcon, @@ -774,9 +773,7 @@ ipc.on('set-is-call-active', (_event, isCallActive) => { return; } - // We are evaluating background throttling in development. If we decide to move - // forward, we can remove this check. - if (!development) { + if (!isThrottlingEnabled) { return; }