diff --git a/ts/components/DialogUpdate.stories.tsx b/ts/components/DialogUpdate.stories.tsx index 0396ed9870..455ce9de10 100644 --- a/ts/components/DialogUpdate.stories.tsx +++ b/ts/components/DialogUpdate.stories.tsx @@ -49,6 +49,7 @@ story.add('Knobs Playground', () => { dialogType={dialogType} didSnooze={didSnooze} hasNetworkDialog={hasNetworkDialog} + currentVersion="5.24.0" /> ); @@ -70,6 +71,7 @@ story.add('Knobs Playground', () => { )); @@ -79,6 +81,7 @@ story.add('Knobs Playground', () => { )); @@ -88,6 +91,7 @@ story.add('Knobs Playground', () => { )); @@ -97,6 +101,17 @@ story.add('Knobs Playground', () => { + + )); + + story.add(`Cannot Update Beta (${name} container)`, () => ( + + )); @@ -106,6 +121,7 @@ story.add('Knobs Playground', () => { )); diff --git a/ts/components/DialogUpdate.tsx b/ts/components/DialogUpdate.tsx index 201dd11389..1e631ee8d3 100644 --- a/ts/components/DialogUpdate.tsx +++ b/ts/components/DialogUpdate.tsx @@ -4,6 +4,7 @@ import React from 'react'; import formatFileSize from 'filesize'; +import { isBeta } from '../util/version'; import { DialogType } from '../types/Dialogs'; import type { LocalizerType } from '../types/Util'; import { Intl } from './Intl'; @@ -23,8 +24,12 @@ export type PropsType = { snoozeUpdate: () => void; startUpdate: () => void; version?: string; + currentVersion: string; }; +const PRODUCTION_DOWNLOAD_URL = 'https://signal.org/download/'; +const BETA_DOWNLOAD_URL = 'https://support.signal.org/beta'; + export const DialogUpdate = ({ containerWidthBreakpoint, dialogType, @@ -37,6 +42,7 @@ export const DialogUpdate = ({ snoozeUpdate, startUpdate, version, + currentVersion, }: PropsType): JSX.Element | null => { if (hasNetworkDialog) { return null; @@ -51,6 +57,9 @@ export const DialogUpdate = ({ } if (dialogType === DialogType.Cannot_Update) { + const url = isBeta(currentVersion) + ? BETA_DOWNLOAD_URL + : PRODUCTION_DOWNLOAD_URL; return ( - https://signal.org/download/ + {url} , ]} i18n={i18n} diff --git a/ts/state/smart/UpdateDialog.tsx b/ts/state/smart/UpdateDialog.tsx index 93288304b2..3d001563d9 100644 --- a/ts/state/smart/UpdateDialog.tsx +++ b/ts/state/smart/UpdateDialog.tsx @@ -16,6 +16,7 @@ const mapStateToProps = (state: StateType, ownProps: PropsType) => { ...state.updates, hasNetworkDialog: hasNetworkDialog(state), i18n: getIntl(state), + currentVersion: window.getVersion(), ...ownProps, }; };