From 7214d686d1b826c07758d54b02b5be003aa4efd2 Mon Sep 17 00:00:00 2001 From: Monalisha Mishra Date: Wed, 21 Feb 2024 17:26:19 +0530 Subject: [PATCH] fix: fixed readmode --- packages/restapi/src/lib/pushapi/chat.ts | 6 +++--- packages/restapi/src/lib/pushapi/space.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/restapi/src/lib/pushapi/chat.ts b/packages/restapi/src/lib/pushapi/chat.ts index 556c308e2..aef943ca9 100644 --- a/packages/restapi/src/lib/pushapi/chat.ts +++ b/packages/restapi/src/lib/pushapi/chat.ts @@ -73,7 +73,7 @@ export class Chat { page: options?.page, limit: options?.limit, env: this.env, - toDecrypt: !!this.signer, // Set to false if signer is undefined or null, + toDecrypt: !!this.decryptedPgpPvtKey, // Set to false if signer is undefined or null, }; switch (type) { @@ -96,7 +96,7 @@ export class Chat { const latestMessages = await PUSH_CHAT.latest({ threadhash: threadHash, - toDecrypt: !!this.signer, // Set to false if signer is undefined or null, + toDecrypt: !!this.decryptedPgpPvtKey, // Set to false if signer is undefined or null, pgpPrivateKey: this.decryptedPgpPvtKey, account: this.account, env: this.env, @@ -131,7 +131,7 @@ export class Chat { env: this.env, threadhash: reference, pgpPrivateKey: this.decryptedPgpPvtKey, - toDecrypt: !!this.signer, // Set to false if signer is undefined or null, + toDecrypt: !!this.decryptedPgpPvtKey, // Set to false if signer is undefined or null, limit: options?.limit, }); const listType = intent ? 'CHATS' : 'REQUESTS'; diff --git a/packages/restapi/src/lib/pushapi/space.ts b/packages/restapi/src/lib/pushapi/space.ts index dff3dbded..c92225a58 100644 --- a/packages/restapi/src/lib/pushapi/space.ts +++ b/packages/restapi/src/lib/pushapi/space.ts @@ -485,7 +485,7 @@ export class Space { page: options?.page, limit: options?.limit, env: this.env, - toDecrypt: !!this.signer, // Set to false if signer is undefined or null, + toDecrypt: !!this.decryptedPgpPvtKey, // Set to false if signer is undefined or null, }; switch (type) {