From cd98cac4e4bb0c22b2ba99e16b65f47188e136be Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 6 Sep 2021 12:46:44 +0200 Subject: [PATCH] split out Entry type for OlmSessionStore --- src/matrix/storage/idb/stores/OlmSessionStore.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/matrix/storage/idb/stores/OlmSessionStore.ts b/src/matrix/storage/idb/stores/OlmSessionStore.ts index eee2074b..1daa0b21 100644 --- a/src/matrix/storage/idb/stores/OlmSessionStore.ts +++ b/src/matrix/storage/idb/stores/OlmSessionStore.ts @@ -29,13 +29,14 @@ interface OlmSession { sessionId: string; senderKey: string; lastUsed: number; - key: string; } -export class OlmSessionStore { - private _store: Store; +type OlmSessionEntry = OlmSession & { key: string }; - constructor(store: Store) { +export class OlmSessionStore { + private _store: Store; + + constructor(store: Store) { this._store = store; } @@ -66,8 +67,8 @@ export class OlmSessionStore { } set(session: OlmSession): void { - session.key = encodeKey(session.senderKey, session.sessionId); - this._store.put(session); + (session as OlmSessionEntry).key = encodeKey(session.senderKey, session.sessionId); + this._store.put(session as OlmSessionEntry); } remove(senderKey: string, sessionId: string): Promise {