From 539e5d9c2abf4ed5d389c6c2a12d3ac0d8e5f7bc Mon Sep 17 00:00:00 2001 From: gekkedev <17025257+gekkedev@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:13:08 +0200 Subject: [PATCH] feat: Added client.closeChat function (close #2271) (#2290) --- src/api/layers/ui.layer.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/layers/ui.layer.ts b/src/api/layers/ui.layer.ts index 601d0cee9..a1096d028 100644 --- a/src/api/layers/ui.layer.ts +++ b/src/api/layers/ui.layer.ts @@ -52,6 +52,16 @@ export class UILayer extends GroupLayer { chatId ); } + + /** + * Closes the currently opened chat (if any). + * The boolean result reflects if there was any chat that got closed. + * @category UI + */ + public async closeChat() { + return evaluateAndReturn(this.page, () => WPP.chat.closeChat()); + } + /** * Return the current active chat * @category UI