Skip to content

Commit

Permalink
fix: Fixed logout method (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Oct 20, 2021
1 parent 8ed1d86 commit ae2fbfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class Whatsapp extends BusinessLayer {
* @returns boolean
*/
public async logout() {
return await evaluateAndReturn(this.page, () => WAPI.logout());
return await evaluateAndReturn(this.page, () => WPP.auth.logout());
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/lib/wapi/wapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,7 @@ if (typeof window.WAPI === 'undefined') {
};

window.WAPI.logout = async function () {
return await window.WAPI.waitForStore(['ws2'], () => {
window.Store.ws2.logout();
return true;
});
return await WPP.auth.logout();
};

window.WAPI.storePromises = {};
Expand Down

0 comments on commit ae2fbfb

Please sign in to comment.