From c2a9f2393b4b7c2bb5c1f08f4cb75066a097edf9 Mon Sep 17 00:00:00 2001 From: Cleiton Carvalho Date: Mon, 29 May 2023 20:43:31 -0300 Subject: [PATCH] feat: Added client.isOnline function --- src/api/layers/host.layer.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/layers/host.layer.ts b/src/api/layers/host.layer.ts index 6e9bc7bd0..8527734f2 100644 --- a/src/api/layers/host.layer.ts +++ b/src/api/layers/host.layer.ts @@ -462,6 +462,14 @@ export class HostLayer { return await evaluateAndReturn(this.page, () => WAPI.isConnected()); } + /** + * Check is online + * @category Host + */ + public async isOnline(): Promise { + return await evaluateAndReturn(this.page, () => WPP.conn.isOnline()); + } + /** * Retrieves if the phone is online. Please note that this may not be real time. * @category Host