Skip to content

Commit

Permalink
Disable auto-download of updates on Linux
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and josh-signal committed Aug 23, 2021
1 parent 96b9992 commit ece6e09
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions ts/components/Preferences.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const createProps = (): PropsType => ({
),

isAudioNotificationsSupported: true,
isAutoDownloadUpdatesSupported: true,
isAutoLaunchSupported: true,
isHideMenuBarSupported: true,
isNotificationAttentionSupported: true,
Expand Down
22 changes: 13 additions & 9 deletions ts/components/Preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export type PropsType = {

// Limited support features
isAudioNotificationsSupported: boolean;
isAutoDownloadUpdatesSupported: boolean;
isAutoLaunchSupported: boolean;
isHideMenuBarSupported: boolean;
isNotificationAttentionSupported: boolean;
Expand Down Expand Up @@ -184,6 +185,7 @@ export const Preferences = ({
i18n,
initialSpellCheckSetting,
isAudioNotificationsSupported,
isAutoDownloadUpdatesSupported,
isAutoLaunchSupported,
isHideMenuBarSupported,
isPhoneNumberSharingSupported,
Expand Down Expand Up @@ -344,15 +346,17 @@ export const Preferences = ({
onChange={onMediaCameraPermissionsChange}
/>
</SettingsRow>
<SettingsRow title={i18n('Preferences--updates')}>
<Checkbox
checked={hasAutoDownloadUpdate}
label={i18n('Preferences__download-update')}
moduleClassName="Preferences__checkbox"
name="autoDownloadUpdate"
onChange={onAutoDownloadUpdateChange}
/>
</SettingsRow>
{isAutoDownloadUpdatesSupported && (
<SettingsRow title={i18n('Preferences--updates')}>
<Checkbox
checked={hasAutoDownloadUpdate}
label={i18n('Preferences__download-update')}
moduleClassName="Preferences__checkbox"
name="autoDownloadUpdate"
onChange={onAutoDownloadUpdateChange}
/>
</SettingsRow>
)}
</>
);
} else if (page === Page.Appearance) {
Expand Down
3 changes: 3 additions & 0 deletions ts/types/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
1 change: 1 addition & 0 deletions ts/windows/settings/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit ece6e09

Please sign in to comment.