diff --git a/ts/session/sending/PendingMessageCache.ts b/ts/session/sending/PendingMessageCache.ts index 1fd9574b7..43c84cd4a 100644 --- a/ts/session/sending/PendingMessageCache.ts +++ b/ts/session/sending/PendingMessageCache.ts @@ -2,7 +2,7 @@ import { createOrUpdateItem, getItemById, } from '../../../js/modules/data'; -import { BareRawMessage, RawMessage } from '../types/RawMessage'; +import { PartialRawMessage, RawMessage } from '../types/RawMessage'; import { ContentMessage } from '../messages/outgoing'; import { PubKey } from '../types'; import * as MessageUtils from '../utils'; @@ -107,11 +107,11 @@ export class PendingMessageCache { return []; } - const barePending = JSON.parse(String(data.value)) as Array; + const barePending = JSON.parse(String(data.value)) as Array; // Rebuild plainTextBuffer // tslint:disable-next-line: no-unnecessary-local-variable - const pending = barePending.map((message: BareRawMessage) => { + const pending = barePending.map((message: PartialRawMessage) => { const rebuiltMessage = { ...message }; // From Array to ArrayBuffer diff --git a/ts/session/types/RawMessage.ts b/ts/session/types/RawMessage.ts index 490dbf041..a0333c603 100644 --- a/ts/session/types/RawMessage.ts +++ b/ts/session/types/RawMessage.ts @@ -11,7 +11,8 @@ export interface RawMessage { encryption: EncryptionType; } -export interface BareRawMessage { +// For building RawMessages from JSON +export interface PartialRawMessage { identifier: string; plainTextBuffer: any; timestamp: number;