Enforce stronger types for ArrayBuffers and storage
This commit is contained in:
parent
61ac79e9ae
commit
8f5086227a
56 changed files with 748 additions and 675 deletions
|
@ -4,6 +4,8 @@
|
|||
import { PublicKey, Fingerprint } from '@signalapp/signal-client';
|
||||
import { ConversationType } from '../state/ducks/conversations';
|
||||
|
||||
import { assert } from './assert';
|
||||
|
||||
export async function generateSecurityNumber(
|
||||
ourNumber: string,
|
||||
ourKey: ArrayBuffer,
|
||||
|
@ -35,7 +37,7 @@ export async function generateSecurityNumberBlock(
|
|||
const ourUuid = window.textsecure.storage.user.getUuid();
|
||||
|
||||
const us = window.textsecure.storage.protocol.getIdentityRecord(
|
||||
ourUuid || ourNumber
|
||||
ourUuid || ourNumber || ''
|
||||
);
|
||||
const ourKey = us ? us.publicKey : null;
|
||||
|
||||
|
@ -57,6 +59,7 @@ export async function generateSecurityNumberBlock(
|
|||
return [];
|
||||
}
|
||||
|
||||
assert(ourNumber, 'Should have our number');
|
||||
const securityNumber = await generateSecurityNumber(
|
||||
ourNumber,
|
||||
ourKey,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue