Adjust timeouts for better performance
This commit is contained in:
parent
172598b354
commit
3a726ad311
4 changed files with 16 additions and 7 deletions
|
@ -765,7 +765,15 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
|||
if (!conversation) {
|
||||
return;
|
||||
}
|
||||
conversationChanged(conversation.id, conversation.format());
|
||||
|
||||
// This delay ensures that the .format() call isn't synchronous as a
|
||||
// Backbone property is changed. Important because our _byUuid/_byE164
|
||||
// lookups aren't up-to-date as the change happens; just a little bit
|
||||
// after.
|
||||
setTimeout(
|
||||
() => conversationChanged(conversation.id, conversation.format()),
|
||||
1
|
||||
);
|
||||
});
|
||||
convoCollection.on('reset', removeAllConversations);
|
||||
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ class ProvisioningCipherInner {
|
|||
const ret: ProvisionDecryptResult = {
|
||||
identityKeyPair: keyPair,
|
||||
number: provisionMessage.number,
|
||||
uuid: provisionMessage.uuid,
|
||||
provisioningCode: provisionMessage.provisioningCode,
|
||||
userAgent: provisionMessage.userAgent,
|
||||
readReceipts: provisionMessage.readReceipts,
|
||||
|
|
|
@ -2366,6 +2366,7 @@ export function initialize({
|
|||
password: auth.password,
|
||||
responseType: 'jsonwithdetails',
|
||||
data,
|
||||
timeout: 30000,
|
||||
version,
|
||||
});
|
||||
|
||||
|
@ -2489,6 +2490,7 @@ export function initialize({
|
|||
user: directoryAuth.username,
|
||||
password: directoryAuth.password,
|
||||
responseType: 'json',
|
||||
timeout: 30000,
|
||||
data: JSON.stringify(data),
|
||||
version,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue