From 2ad44b0ef4667e54ba1c39611c1c2fbfd72b0931 Mon Sep 17 00:00:00 2001 From: Salah Benmoussati <51402489+sbenmoussati@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:15:05 +0100 Subject: [PATCH] SDA-4482 Auto-update should check value defined in user config (#2098) --- src/app/app-menu.ts | 12 ++++++++++-- src/app/auto-update-handler.ts | 10 ++++++++++ src/app/window-utils.ts | 6 ++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/app/app-menu.ts b/src/app/app-menu.ts index 2263f6ea..cd5335ca 100644 --- a/src/app/app-menu.ts +++ b/src/app/app-menu.ts @@ -298,6 +298,10 @@ export class AppMenu { */ private buildAboutMenu(): Electron.MenuItemConstructorOptions { logger.info(`app-menu: building about menu`); + const isCorp = + (windowHandler.url && + windowHandler.url.startsWith('https://corporate.symphony.com')) || + false; return { id: menuSections.about, label: app.getName(), @@ -320,7 +324,9 @@ export class AppMenu { isMac && !!( (isAutoUpdateEnabled || forceAutoUpdate) && - (betaAutoUpdateChannelEnabled || latestAutoUpdateChannelEnabled) + (betaAutoUpdateChannelEnabled || + latestAutoUpdateChannelEnabled || + isCorp) ) && !!windowHandler.isMana, label: i18n.t('Check for updates')(), @@ -725,7 +731,9 @@ export class AppMenu { isWindowsOS && !!( (isAutoUpdateEnabled || forceAutoUpdate) && - (betaAutoUpdateChannelEnabled || latestAutoUpdateChannelEnabled) + (betaAutoUpdateChannelEnabled || + latestAutoUpdateChannelEnabled || + isCorp) ) && !!windowHandler.isMana, label: i18n.t('Check for updates')(), diff --git a/src/app/auto-update-handler.ts b/src/app/auto-update-handler.ts index 9ee973dc..45674950 100644 --- a/src/app/auto-update-handler.ts +++ b/src/app/auto-update-handler.ts @@ -255,6 +255,16 @@ export class AutoUpdate { this.finalAutoUpdateChannel = autoUpdateChannel; this.installVariant = installVariant; + const isCorp = + (windowHandler?.url && + windowHandler.url.startsWith('https://corporate.symphony.com')) || + false; + + // Corp should keep the ability to get auto-update channel from user config as top prio + if (isCorp && this.finalAutoUpdateChannel !== UpdateChannel.LATEST) { + return; + } + const pmp = config.getFilteredCloudConfigFields([ 'sdaInstallerMsiUrlEnabledVisible', 'sdaInstallerMsiUrlBetaEnabledVisible', diff --git a/src/app/window-utils.ts b/src/app/window-utils.ts index 9a009850..adb9b848 100644 --- a/src/app/window-utils.ts +++ b/src/app/window-utils.ts @@ -1348,6 +1348,7 @@ export const loadBrowserViews = async ( }, 50); const onMaximizeHandler = () => { + logger.info('window-change: maximizing'); if (!mainView || !viewExists(mainView)) { return; } @@ -1361,6 +1362,11 @@ export const loadBrowserViews = async ( ) { return; } + logger.info( + 'window-change: maximizing with bounds ', + currentScreenBounds.width, + currentScreenBounds.height, + ); mainView.setBounds({ width: currentScreenBounds.width, height: currentScreenBounds.height - TITLE_BAR_HEIGHT,