@@ -199,15 +188,25 @@ export function DialogUpdate({
);
}
- let clickLabel: string;
+ let title = i18n('autoUpdateNewVersionTitle');
+
+ if (
+ downloadSize &&
+ (dialogType === DialogType.DownloadReady ||
+ dialogType === DialogType.FullDownloadReady)
+ ) {
+ title += ` (${formatFileSize(downloadSize, { round: 0 })})`;
+ }
+
+ let clickLabel = i18n('autoUpdateNewVersionMessage');
let type: 'warning' | undefined;
if (dialogType === DialogType.DownloadReady) {
clickLabel = i18n('downloadNewVersionMessage');
} else if (dialogType === DialogType.FullDownloadReady) {
clickLabel = i18n('downloadFullNewVersionMessage');
type = 'warning';
- } else {
- clickLabel = i18n('autoUpdateNewVersionMessage');
+ } else if (dialogType === DialogType.DownloadedUpdate) {
+ title = i18n('icu:DialogUpdate__downloaded');
}
return (
diff --git a/ts/components/LeftPane.stories.tsx b/ts/components/LeftPane.stories.tsx
index 63821b359274..e7ddc3119a44 100644
--- a/ts/components/LeftPane.stories.tsx
+++ b/ts/components/LeftPane.stories.tsx
@@ -205,7 +205,7 @@ const useProps = (overrideProps: OverridePropsType = {}): PropsType => {
dialogType === DialogType.Update
+ ({ dialogType }) =>
+ dialogType === DialogType.AutoUpdate ||
+ dialogType === DialogType.DownloadedUpdate
);
export const isOSUnsupported = createSelector(
diff --git a/ts/types/Dialogs.ts b/ts/types/Dialogs.ts
index 5adbf9b2f782..fdba452b8d64 100644
--- a/ts/types/Dialogs.ts
+++ b/ts/types/Dialogs.ts
@@ -3,7 +3,7 @@
export enum DialogType {
None = 'None',
- Update = 'Update',
+ AutoUpdate = 'AutoUpdate',
Cannot_Update = 'Cannot_Update',
Cannot_Update_Require_Manual = 'Cannot_Update_Require_Manual',
UnsupportedOS = 'UnsupportedOS',
@@ -11,4 +11,5 @@ export enum DialogType {
DownloadReady = 'DownloadReady',
FullDownloadReady = 'FullDownloadReady',
Downloading = 'Downloading',
+ DownloadedUpdate = 'DownloadedUpdate',
}
diff --git a/ts/updater/common.ts b/ts/updater/common.ts
index 98bdb738f0a6..7332fdba885c 100644
--- a/ts/updater/common.ts
+++ b/ts/updater/common.ts
@@ -260,9 +260,15 @@ export abstract class Updater {
const mainWindow = this.getMainWindow();
if (mainWindow) {
logger.info('downloadAndInstall: showing update dialog...');
- mainWindow.webContents.send('show-update-dialog', DialogType.Update, {
- version: this.version,
- });
+ mainWindow.webContents.send(
+ 'show-update-dialog',
+ mode === DownloadMode.Automatic
+ ? DialogType.AutoUpdate
+ : DialogType.DownloadedUpdate,
+ {
+ version: this.version,
+ }
+ );
} else {
logger.warn(
'downloadAndInstall: no mainWindow, cannot show update dialog'