From 0c038f2971c14329436011e6727bd3d5aead1d38 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:04:11 -0800 Subject: [PATCH] Show backup import UI on Link-and-Sync --- ts/state/ducks/installer.ts | 2 +- ts/textsecure/Provisioner.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ts/state/ducks/installer.ts b/ts/state/ducks/installer.ts index 0d4f170ff..97ff2f3c6 100644 --- a/ts/state/ducks/installer.ts +++ b/ts/state/ducks/installer.ts @@ -363,7 +363,7 @@ function finishInstall( const accountManager = window.getAccountManager(); strictAssert(accountManager, 'Expected an account manager'); - if (isBackupEnabled()) { + if (isBackupEnabled() || provisioner.isLinkAndSync()) { dispatch({ type: SHOW_BACKUP_IMPORT }); } else { dispatch({ type: SHOW_LINK_IN_PROGRESS }); diff --git a/ts/textsecure/Provisioner.ts b/ts/textsecure/Provisioner.ts index 9f7162166..62f1469e4 100644 --- a/ts/textsecure/Provisioner.ts +++ b/ts/textsecure/Provisioner.ts @@ -227,6 +227,20 @@ export class Provisioner { }; } + public isLinkAndSync(): boolean { + strictAssert( + this.state.step === Step.ReadyToLink, + `Invalid state for prepareLinkData: ${this.state.step}` + ); + + const { envelope } = this.state; + + return ( + isLinkAndSyncEnabled(this.appVersion) && + Bytes.isNotEmpty(envelope.ephemeralBackupKey) + ); + } + private handleRequest(request: IncomingWebSocketRequest): void { const pubKey = this.cipher.getPublicKey();