Show backup import UI on Link-and-Sync

This commit is contained in:
Fedor Indutny 2024-11-04 15:04:11 -08:00 committed by GitHub
parent 936d21d749
commit 0c038f2971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View file

@ -363,7 +363,7 @@ function finishInstall(
const accountManager = window.getAccountManager(); const accountManager = window.getAccountManager();
strictAssert(accountManager, 'Expected an account manager'); strictAssert(accountManager, 'Expected an account manager');
if (isBackupEnabled()) { if (isBackupEnabled() || provisioner.isLinkAndSync()) {
dispatch({ type: SHOW_BACKUP_IMPORT }); dispatch({ type: SHOW_BACKUP_IMPORT });
} else { } else {
dispatch({ type: SHOW_LINK_IN_PROGRESS }); dispatch({ type: SHOW_LINK_IN_PROGRESS });

View file

@ -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 { private handleRequest(request: IncomingWebSocketRequest): void {
const pubKey = this.cipher.getPublicKey(); const pubKey = this.cipher.getPublicKey();