Skip to content

Commit

Permalink
fix: Fixed rejectCall method
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Mar 11, 2023
1 parent 86454a5 commit 194ed96
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 77 deletions.
6 changes: 3 additions & 3 deletions src/api/whatsapp.ts
Expand Up @@ -41,7 +41,7 @@ export class Whatsapp extends BusinessLayer {

interval = setInterval(async (state) => {
const newConnected = await page
.evaluate(() => WAPI.isRegistered())
.evaluate(() => WPP.conn.isRegistered())
.catch(() => null);

if (newConnected === null || newConnected === this.connected) {
Expand All @@ -65,7 +65,7 @@ export class Whatsapp extends BusinessLayer {
protected async afterPageScriptInjected() {
await super.afterPageScriptInjected();
this.page
.evaluate(() => WAPI.isRegistered())
.evaluate(() => WPP.conn.isRegistered())
.then((isAuthenticated) => {
this.connected = isAuthenticated;
})
Expand Down Expand Up @@ -218,7 +218,7 @@ export class Whatsapp extends BusinessLayer {
public async rejectCall(callId?: string) {
return await evaluateAndReturn(
this.page,
({ callId }) => WAPI.rejectCall(callId),
({ callId }) => WPP.call.rejectCall(callId),
{
callId,
}
Expand Down
1 change: 0 additions & 1 deletion src/lib/wapi/functions/index.js
Expand Up @@ -84,7 +84,6 @@ export { createProduct } from './create-product';
export { getListMute, interfaceMute } from './get-list-mute';
export * from './phoneWatchdog';
export * from './presence';
export * from './reject-call';
export * from './set-online-presence';
export * from './set-temporary-messages';
export * from './star-messages';
68 changes: 0 additions & 68 deletions src/lib/wapi/functions/reject-call.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/lib/wapi/wapi.js
Expand Up @@ -91,7 +91,6 @@ import {
subscribePresence,
unsubscribePresence,
getMessages,
rejectCall,
setOnlinePresence,
} from './functions';
import {
Expand Down Expand Up @@ -271,9 +270,6 @@ if (typeof window.WAPI === 'undefined') {
window.WAPI.getBusinessProfilesProducts = getBusinessProfilesProducts;
window.WAPI.getOrderbyMsg = getOrderbyMsg;

// call functions
window.WAPI.rejectCall = rejectCall;

// Listeners initialization
window.WAPI._newMessagesQueue = [];
window.WAPI._newMessagesBuffer =
Expand Down
1 change: 0 additions & 1 deletion src/types/WAPI.d.ts
Expand Up @@ -106,7 +106,6 @@ interface WAPI {
option: boolean,
nonExistent?: boolean
) => Promise<object>;
rejectCall: (callId?: string) => Promise<number>;
sendChatstate: (chatState: string, chatId: string) => void;
sendFile: (
base64: string,
Expand Down

0 comments on commit 194ed96

Please sign in to comment.