diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0e19689d7..3adc96fa1 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -5459,6 +5459,26 @@ "messageformat": "Update Downloaded", "description": "The title of update dialog when update download is completed." }, + "icu:InstallScreenUpdateDialog--unsupported-os__title": { + "messageformat": "Update Required", + "description": "The title of update dialog on install screen when user OS is unsupported" + }, + "icu:InstallScreenUpdateDialog--auto-update__body": { + "messageformat": "To continue using Signal, you must update to the latest version.", + "description": "The body of update dialog on install screen when auto update is downloaded and available." + }, + "icu:InstallScreenUpdateDialog--manual-update__action": { + "messageformat": "Download {downloadSize}", + "description": "The text of a confirmation button in update dialog on install screen when manual update is ready to be downloaded." + }, + "icu:InstallScreenUpdateDialog--downloaded__body": { + "messageformat": "Restart Signal to install the update.", + "description": "The body of the update dialog on install screen when manual update was downloaded." + }, + "icu:InstallScreenUpdateDialog--cannot-update__body": { + "messageformat": "Signal Desktop failed to update, but there is a new version available. Go to {downloadUrl} and install the new version manually, then either contact support or file a bug about this problem.", + "description": "The body of the update dialog on install screen when update cannot be installed." + }, "NSIS__retry-dialog--first-line": { "message": "Signal cannot be closed.", "description": "First line of the dialog displayed when Windows installer can't close application automatically and needs user intervention to complete the installation." diff --git a/stylesheets/components/InstallScreenUpdateDialog.scss b/stylesheets/components/InstallScreenUpdateDialog.scss new file mode 100644 index 000000000..71658d16e --- /dev/null +++ b/stylesheets/components/InstallScreenUpdateDialog.scss @@ -0,0 +1,39 @@ +// Copyright 2023 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +.InstallScreenUpdateDialog { + &__download-size { + font-weight: 400; + } + + &__progress { + &--container { + @include light-theme() { + background-color: $color-gray-15; + } + @include dark-theme() { + background-color: $color-gray-65; + } + border-radius: 2px; + height: 4px; + overflow: hidden; + width: 100%; + margin: 16px 0; + } + + &--bar { + background-color: $color-ultramarine; + border-radius: 2px; + display: block; + height: 100%; + width: 100%; + transform: translateX(-100%); + transition: transform 500ms ease-out; + } + } + + a { + // Prevent breaking the text + display: inline-block; + } +} diff --git a/stylesheets/manifest.scss b/stylesheets/manifest.scss index cbff6336b..7e6c4c884 100644 --- a/stylesheets/manifest.scss +++ b/stylesheets/manifest.scss @@ -88,6 +88,7 @@ @import './components/InstallScreenLinkInProgressStep.scss'; @import './components/InstallScreenQrCodeNotScannedStep.scss'; @import './components/InstallScreenSignalLogo.scss'; +@import './components/InstallScreenUpdateDialog.scss'; @import './components/LeftPaneDialog.scss'; @import './components/LeftPaneSearchInput.scss'; @import './components/Lightbox.scss'; diff --git a/ts/background.ts b/ts/background.ts index b6d94e430..8bcc35699 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -1781,6 +1781,7 @@ export async function startApp(): Promise { } window.Whisper.events.on('setupAsNewDevice', () => { + window.IPC.readyForUpdates(); window.reduxActions.app.openInstaller(); }); @@ -1967,6 +1968,7 @@ export async function startApp(): Promise { void connect(); window.reduxActions.app.openInbox(); } else { + window.IPC.readyForUpdates(); window.reduxActions.app.openInstaller(); } diff --git a/ts/components/ConfirmationDialog.tsx b/ts/components/ConfirmationDialog.tsx index ce36de885..aa683ab17 100644 --- a/ts/components/ConfirmationDialog.tsx +++ b/ts/components/ConfirmationDialog.tsx @@ -13,11 +13,19 @@ import { useAnimated } from '../hooks/useAnimated'; import { Spinner } from './Spinner'; export type ActionSpec = { - text: string; action: () => unknown; style?: 'affirmative' | 'negative'; autoClose?: boolean; -}; +} & ( + | { + text: string; + id?: string; + } + | { + text: string | JSX.Element; + id: string; + } +); export type OwnProps = Readonly<{ actions?: Array; @@ -117,7 +125,11 @@ export const ConfirmationDialog = React.memo(function ConfirmationDialogInner({ ) : null} {actions.map((action, i) => (