From 353fea5d66dec4e6bdbf33b437cbce5f251f292b Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 20 Aug 2021 17:41:58 -0400 Subject: [PATCH] Disables auto-download updates on Linux --- ts/components/Preferences.stories.tsx | 1 + ts/components/Preferences.tsx | 22 +++++++++++++--------- ts/types/Settings.ts | 3 +++ ts/windows/settings/preload.ts | 1 + 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ts/components/Preferences.stories.tsx b/ts/components/Preferences.stories.tsx index 43d41b1b6..2282e40dc 100644 --- a/ts/components/Preferences.stories.tsx +++ b/ts/components/Preferences.stories.tsx @@ -118,6 +118,7 @@ const createProps = (): PropsType => ({ ), isAudioNotificationsSupported: true, + isAutoDownloadUpdatesSupported: true, isAutoLaunchSupported: true, isHideMenuBarSupported: true, isNotificationAttentionSupported: true, diff --git a/ts/components/Preferences.tsx b/ts/components/Preferences.tsx index 04c643ccf..629a19195 100644 --- a/ts/components/Preferences.tsx +++ b/ts/components/Preferences.tsx @@ -96,6 +96,7 @@ export type PropsType = { // Limited support features isAudioNotificationsSupported: boolean; + isAutoDownloadUpdatesSupported: boolean; isAutoLaunchSupported: boolean; isHideMenuBarSupported: boolean; isNotificationAttentionSupported: boolean; @@ -184,6 +185,7 @@ export const Preferences = ({ i18n, initialSpellCheckSetting, isAudioNotificationsSupported, + isAutoDownloadUpdatesSupported, isAutoLaunchSupported, isHideMenuBarSupported, isPhoneNumberSharingSupported, @@ -344,15 +346,17 @@ export const Preferences = ({ onChange={onMediaCameraPermissionsChange} /> - - - + {isAutoDownloadUpdatesSupported && ( + + + + )} ); } else if (page === Page.Appearance) { diff --git a/ts/types/Settings.ts b/ts/types/Settings.ts index 8cbb71042..44e1d0006 100644 --- a/ts/types/Settings.ts +++ b/ts/types/Settings.ts @@ -58,3 +58,6 @@ export const getTitleBarVisibility = (): TitleBarVisibility => export const isSystemTraySupported = (appVersion: string): boolean => // We eventually want to support Linux in production. OS.isWindows() || (OS.isLinux() && !isProduction(appVersion)); + +export const isAutoDownloadUpdatesSupported = (): boolean => + OS.isWindows() || OS.isMacOS(); diff --git a/ts/windows/settings/preload.ts b/ts/windows/settings/preload.ts index 057e0eeb8..4b5fde21b 100644 --- a/ts/windows/settings/preload.ts +++ b/ts/windows/settings/preload.ts @@ -305,6 +305,7 @@ async function renderPreferences() { // Limited support features isAudioNotificationsSupported: Settings.isAudioNotificationSupported(), + isAutoDownloadUpdatesSupported: Settings.isAutoDownloadUpdatesSupported(), isAutoLaunchSupported: Settings.isAutoLaunchSupported(), isHideMenuBarSupported: Settings.isHideMenuBarSupported(), isNotificationAttentionSupported: Settings.isDrawAttentionSupported(),