Closed sergey-chechaev closed 2 years ago
Function dont exist in beta version.
this works for me:
{ id: 'checkNumberBeta', conditions: (module) => module.default && typeof module.default.toString === 'function' && module.default.toString().includes('Should not reach queryExists MD') ? module.default : null },
window.WAPI.isBeta = function () {
if (
!window.localStorage.getItem('WASecretBundle') &&
!window.localStorage.getItem('WAToken1') &&
!window.localStorage.getItem('WAToken2')
) {
return true;
}
return false;
}
window.WAPI.checkNumberStatus = function (id, done) {
if (window.WAPI.isBeta) {
return await window.Store.checkNumberBeta(id)
.then((result) => {
if (!!result && typeof result === 'object') {
// number exists
} else {
// number not exists
}
})
.catch((err) => {
// number not exists
});
} else {
window.Store.WapQuery.queryExist(id).then((result) => {
if (done !== undefined) {
if (result.jid === undefined) throw 404;
done(window.WAPI._serializeNumberStatusObj(result));
}
}).catch((e) => {
if (done !== undefined) {
done(window.WAPI._serializeNumberStatusObj({
status: e,
jid: id
}));
}
});
return true;
}
};
Fix in js.abr version 1.1.0.0
Function checkNumberStatus do not work for Multi-Device Beta version of WhatsApp
{ id: "WapQuery", conditions: (module) => (module.default && module.default.queryExist) ? module.default : null }