-
{i18n('icu:BackupImportScreen__title')}
- {progress}
+
{i18n('icu:BackupImportScreen__description')}
@@ -289,3 +252,76 @@ export function InstallScreenBackupImportStep({
);
}
+
+type ProgressBarPropsType = Readonly<
+ {
+ i18n: LocalizerType;
+ } & (
+ | {
+ backupStep: InstallScreenBackupStep.WaitForBackup;
+ }
+ | {
+ backupStep:
+ | InstallScreenBackupStep.Download
+ | InstallScreenBackupStep.Process;
+ currentBytes: number;
+ totalBytes: number;
+ }
+ )
+>;
+
+function ProgressBarAndDescription(props: ProgressBarPropsType): JSX.Element {
+ const { backupStep, i18n } = props;
+ if (backupStep === InstallScreenBackupStep.WaitForBackup) {
+ return (
+ <>
+
+
+ {i18n('icu:BackupImportScreen__progressbar-hint--preparing')}
+
+ >
+ );
+ }
+
+ const { currentBytes, totalBytes } = props;
+
+ const fractionComplete = roundFractionForProgressBar(
+ currentBytes / totalBytes
+ );
+
+ if (backupStep === InstallScreenBackupStep.Download) {
+ return (
+ <>
+
+
+ {i18n('icu:BackupImportScreen__progressbar-hint', {
+ currentSize: formatFileSize(currentBytes),
+ totalSize: formatFileSize(totalBytes),
+ fractionComplete,
+ })}
+
+ >
+ );
+ // eslint-disable-next-line no-else-return
+ } else if (backupStep === InstallScreenBackupStep.Process) {
+ return (
+ <>
+
+
+ {i18n('icu:BackupImportScreen__progressbar-hint--processing')}
+
+ >
+ );
+ } else {
+ throw missingCaseError(backupStep);
+ }
+}
diff --git a/ts/components/installScreen/InstallScreenSignalLogo.tsx b/ts/components/installScreen/InstallScreenSignalLogo.tsx
index 37fde673b..03e3dd87b 100644
--- a/ts/components/installScreen/InstallScreenSignalLogo.tsx
+++ b/ts/components/installScreen/InstallScreenSignalLogo.tsx
@@ -5,5 +5,5 @@ import type { ReactElement } from 'react';
import React from 'react';
export function InstallScreenSignalLogo(): ReactElement {
- return
Signal
;
+ return
;
}
diff --git a/ts/state/ducks/installer.ts b/ts/state/ducks/installer.ts
index 97408d840..c4da8cf44 100644
--- a/ts/state/ducks/installer.ts
+++ b/ts/state/ducks/installer.ts
@@ -63,13 +63,22 @@ export type InstallerStateType = ReadonlyDeep<
| {
step: InstallScreenStep.LinkInProgress;
}
- | {
+ | ({
step: InstallScreenStep.BackupImport;
backupStep: InstallScreenBackupStep;
- currentBytes?: number;
- totalBytes?: number;
error?: InstallScreenBackupError;
- }
+ } & (
+ | {
+ backupStep:
+ | InstallScreenBackupStep.Download
+ | InstallScreenBackupStep.Process;
+ currentBytes: number;
+ totalBytes: number;
+ }
+ | {
+ backupStep: InstallScreenBackupStep.WaitForBackup;
+ }
+ ))
>;
export type RetryBackupImportValue = ReadonlyDeep<'retry' | 'cancel'>;
@@ -594,7 +603,7 @@ export function reducer(
return {
step: InstallScreenStep.BackupImport,
- backupStep: InstallScreenBackupStep.Download,
+ backupStep: InstallScreenBackupStep.WaitForBackup,
};
}
diff --git a/ts/state/smart/InstallScreen.tsx b/ts/state/smart/InstallScreen.tsx
index 287bc7e94..ebd485002 100644
--- a/ts/state/smart/InstallScreen.tsx
+++ b/ts/state/smart/InstallScreen.tsx
@@ -110,10 +110,7 @@ export const SmartInstallScreen = memo(function SmartInstallScreen() {
step: InstallScreenStep.BackupImport,
screenSpecificProps: {
i18n,
- backupStep: installerState.backupStep,
- currentBytes: installerState.currentBytes,
- totalBytes: installerState.totalBytes,
- error: installerState.error,
+ ...installerState,
onCancel: onCancelBackupImport,
onRetry: retryBackupImport,
onRestartLink: startInstaller,
diff --git a/ts/types/InstallScreen.ts b/ts/types/InstallScreen.ts
index f71e9b06d..b4678e5c4 100644
--- a/ts/types/InstallScreen.ts
+++ b/ts/types/InstallScreen.ts
@@ -13,6 +13,7 @@ export enum InstallScreenStep {
}
export enum InstallScreenBackupStep {
+ WaitForBackup = 'WaitForBackup',
Download = 'Download',
Process = 'Process',
}