Skip to content

Commit

Permalink
feat: Added new functions to check conn
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Apr 29, 2023
1 parent 01cb169 commit 0b5e28b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/api/layers/host.layer.ts
Expand Up @@ -507,4 +507,35 @@ export class HostLayer {
public async isMultiDevice() {
return await evaluateAndReturn(this.page, () => WPP.conn.isMultiDevice());
}
/**
* Retrieve main interface is authenticated, loaded and synced
* @category Host
*/
public async isMainReady() {
return await evaluateAndReturn(this.page, () => WPP.conn.isMainReady());
}

/**
* Retrieve if is authenticated
* @category Host
*/
public async isAuthenticated() {
return await evaluateAndReturn(this.page, () => WPP.conn.isAuthenticated());
}

/**
* Retrieve if main interface is authenticated and loaded, bot not synced
* @category Host
*/
public async isMainLoaded() {
return await evaluateAndReturn(this.page, () => WPP.conn.isMainLoaded());
}

/**
* Retrieve if main interface is initializing
* @category Host
*/
public async isMainInit() {
return await evaluateAndReturn(this.page, () => WPP.conn.isMainInit());
}
}

0 comments on commit 0b5e28b

Please sign in to comment.