Fix link-and-sync in Alpha
This commit is contained in:
@@ -59,6 +59,7 @@ import * as log from '../logging/log';
|
|||||||
import type { StorageAccessType } from '../types/Storage';
|
import type { StorageAccessType } from '../types/Storage';
|
||||||
import { getRelativePath, createName } from '../util/attachmentPath';
|
import { getRelativePath, createName } from '../util/attachmentPath';
|
||||||
import { isBackupEnabled } from '../util/isBackupEnabled';
|
import { isBackupEnabled } from '../util/isBackupEnabled';
|
||||||
|
import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled';
|
||||||
import { getMessageQueueTime } from '../util/getMessageQueueTime';
|
import { getMessageQueueTime } from '../util/getMessageQueueTime';
|
||||||
|
|
||||||
type StorageKeyByServiceIdKind = {
|
type StorageKeyByServiceIdKind = {
|
||||||
@@ -1097,10 +1098,14 @@ export default class AccountManager extends EventTarget {
|
|||||||
throw missingCaseError(options);
|
throw missingCaseError(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const shouldDownloadBackup =
|
||||||
|
isBackupEnabled() ||
|
||||||
|
(isLinkAndSyncEnabled(window.getVersion()) && options.ephemeralBackupKey);
|
||||||
|
|
||||||
// Set backup download path before storing credentials to ensure that
|
// Set backup download path before storing credentials to ensure that
|
||||||
// storage service and message receiver are not operating
|
// storage service and message receiver are not operating
|
||||||
// until the backup is downloaded and imported.
|
// until the backup is downloaded and imported.
|
||||||
if (isBackupEnabled() && cleanStart) {
|
if (shouldDownloadBackup && cleanStart) {
|
||||||
if (options.type === AccountType.Linked && options.ephemeralBackupKey) {
|
if (options.type === AccountType.Linked && options.ephemeralBackupKey) {
|
||||||
await storage.put('backupEphemeralKey', options.ephemeralBackupKey);
|
await storage.put('backupEphemeralKey', options.ephemeralBackupKey);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user