Adjust timeouts for better performance

This commit is contained in:
Scott Nonnenberg 2021-01-11 13:59:46 -08:00 committed by GitHub
parent 172598b354
commit 3a726ad311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 7 deletions

View file

@ -487,7 +487,7 @@ export default class AccountManager extends EventTarget {
readReceipts?: boolean | null,
options: { accessKey?: ArrayBuffer; uuid?: string } = {}
): Promise<void> {
const { accessKey } = options;
const { accessKey, uuid } = options;
let password = btoa(
utils.getString(window.libsignal.crypto.getRandomBytes(16))
);
@ -526,8 +526,7 @@ export default class AccountManager extends EventTarget {
);
const numberChanged = previousNumber && previousNumber !== number;
const uuidChanged =
previousUuid && response.uuid && previousUuid !== response.uuid;
const uuidChanged = previousUuid && uuid && previousUuid !== uuid;
if (numberChanged || uuidChanged) {
if (numberChanged) {
@ -576,10 +575,9 @@ export default class AccountManager extends EventTarget {
deviceName
);
const setUuid = response.uuid;
if (setUuid) {
if (uuid) {
await window.textsecure.storage.user.setUuidAndDeviceId(
setUuid,
uuid,
response.deviceId || 1
);
}