Fix link-and-sync cancellation

This commit is contained in:
Fedor Indutny
2025-04-09 12:23:08 -07:00
committed by GitHub
parent 44c4cebb7d
commit a575597396
13 changed files with 165 additions and 98 deletions

View File

@@ -31,7 +31,6 @@ export type PropsType = Readonly<
error?: InstallScreenBackupError;
onCancel: () => void;
onRetry: () => void;
onRestartLink: () => void;
// Updater UI
updates: UpdatesStateType;
@@ -60,7 +59,6 @@ export function InstallScreenBackupImportStep(props: PropsType): JSX.Element {
error,
onCancel,
onRetry,
onRestartLink,
updates,
currentVersion,
OS,
@@ -140,7 +138,7 @@ export function InstallScreenBackupImportStep(props: PropsType): JSX.Element {
title={i18n('icu:BackupImportScreen__error__title')}
actions={[
{
action: onRestartLink,
action: onCancel,
style: 'affirmative',
text: i18n('icu:BackupImportScreen__error__confirm'),
},
@@ -254,6 +252,21 @@ type ProgressBarPropsType = Readonly<
function ProgressBarAndDescription(props: ProgressBarPropsType): JSX.Element {
const { backupStep, i18n, isCanceled } = props;
if (isCanceled) {
return (
<>
<ProgressBar
fractionComplete={null}
isRTL={i18n.getLocaleDirection() === 'rtl'}
/>
<div className="InstallScreenBackupImportStep__progressbar-hint">
{i18n('icu:BackupImportScreen__progressbar-hint--canceling')}
</div>
</>
);
}
if (backupStep === InstallScreenBackupStep.WaitForBackup) {
return (
<>
@@ -274,20 +287,6 @@ function ProgressBarAndDescription(props: ProgressBarPropsType): JSX.Element {
currentBytes / totalBytes
);
if (isCanceled) {
return (
<>
<ProgressBar
fractionComplete={fractionComplete}
isRTL={i18n.getLocaleDirection() === 'rtl'}
/>
<div className="InstallScreenBackupImportStep__progressbar-hint">
{i18n('icu:BackupImportScreen__progressbar-hint--canceling')}
</div>
</>
);
}
if (backupStep === InstallScreenBackupStep.Download) {
return (
<>