From 8c37ccf525a2e6ebcb1d2e05a67ec974cf1e9b6a Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 23 Dec 2021 10:12:29 +0530 Subject: [PATCH] fix: tsc error --- src/Socket/chats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 8a3622f..91a9ee1 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -135,7 +135,8 @@ export const makeChatsSocket = (config: SocketConfig) => { type: 'get' } }) - return result.content[0].content.map(i => i.attrs.jid) + const child = result.content?.[0] as BinaryNode + return (child.content as BinaryNode[])?.map(i => i.attrs.jid) } const updateBlockStatus = async(jid: string, action: 'block' | 'unblock') => {