diff --git a/packages/mtp/src/context.tsx b/packages/mtp/src/context.tsx index 5ca378c..e116d40 100644 --- a/packages/mtp/src/context.tsx +++ b/packages/mtp/src/context.tsx @@ -132,15 +132,27 @@ function deserializeSessionState(value: unknown): MTPSessionState | null { } class LocalMTPSessionStorage implements MTPSessionStorage { + private readonly load: ( + key: K, + ) => Promise | undefined>; + + private readonly save: ( + key: K, + value: Record, + ) => Promise; + constructor( - private readonly load: ( + load: ( key: K, ) => Promise | undefined>, - private readonly save: ( + save: ( key: K, value: Record, ) => Promise, - ) {} + ) { + this.load = load; + this.save = save; + } async getSession(conversationId: string): Promise { const sessions = (await this.load("e2ee_sessions")) ?? {};