From af7ff8e5f406b32360ffc1f9af5d45aaf61ab0f5 Mon Sep 17 00:00:00 2001 From: Monalisha Mishra Date: Thu, 16 Nov 2023 21:12:07 +0300 Subject: [PATCH] fix: fixed build for uiweb --- .husky/pre-commit | 2 +- .../src/app/ChatSupportTest.tsx | 2 +- .../src/lib/components/supportChat/Modal.tsx | 2 -- packages/uiweb/src/lib/helpers/chat/chat.ts | 25 +++++++------------ packages/uiweb/src/lib/hooks/useSDKSocket.ts | 4 ++- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 8a79c3470..2665d0376 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -4,4 +4,4 @@ echo "\nRunning GIT hooks..." yarn cleanbuild yarn nx affected --target=lint -#yarn nx affected --target=test \ No newline at end of file +yarn nx affected --target=test \ No newline at end of file diff --git a/packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx b/packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx index e845b3faf..636b42fe6 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx @@ -35,7 +35,7 @@ export const ChatSupportTest = () => { => { - const { account, signer, env = Constants.ENV.PROD, pushUser } = options || {}; - let connectedUser; +): Promise => { + const { pushUser } = options || {}; + let connectedUser:IUser; if(pushUser){ connectedUser = await pushUser.info(); + return { ...connectedUser, + privateKey: connectedUser!.encryptedPrivateKey, + }; } + return; - return { ...connectedUser, privateKey: connectedUser!.encryptedPrivateKey }; + }; type GetChatsResponseType = { @@ -85,18 +89,7 @@ type DecrypteChatType = { connectedUser: IConnectedUser; env: ENV; }; -export const decryptChat = async ( - options: DecrypteChatType -): Promise => { - const { message, connectedUser, env = Constants.ENV.PROD } = options || {}; - const decryptedChat: IMessageIPFS[] = await PushAPI.chat.decryptConversation({ - messages: [message], - connectedUser, - pgpPrivateKey: connectedUser.privateKey!, - env, - }); - return decryptedChat[0]; -}; + export const copyToClipboard = (address: string): void => { if (navigator && navigator.clipboard) { diff --git a/packages/uiweb/src/lib/hooks/useSDKSocket.ts b/packages/uiweb/src/lib/hooks/useSDKSocket.ts index 6545a7844..bb13c50e7 100644 --- a/packages/uiweb/src/lib/hooks/useSDKSocket.ts +++ b/packages/uiweb/src/lib/hooks/useSDKSocket.ts @@ -93,7 +93,9 @@ export const useSDKSocket =({ account, env = ENV.PROD, socketType = 'chat',apiKe setStream(newstream); // setEpnsSDKSocket(connectionObject); }; - main().catch((err) => console.error(err)); + main().catch((err) => + console.log('') + ); } // eslint-disable-next-line react-hooks/exhaustive-deps