Skip to content

Commit

Permalink
Fix WA 2.2146.9 (#990)
Browse files Browse the repository at this point in the history
* Fix WA 2.2146.9

WA is serving two versions to me,  so we need to check window.mR.findModule('Conn').lengh for a while

* to singleQuotes

* Update Injected.js

* simplify getting `Conn` module, use different object for `Store`

Co-authored-by: Pedro Lopez <pedroslopez@me.com>
  • Loading branch information
tuyuribr and pedroslopez committed Nov 24, 2021
1 parent 818bf48 commit 3958105
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util/Injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ exports.ExposeStore = (moduleRaidStr) => {
eval('var moduleRaid = ' + moduleRaidStr);
// eslint-disable-next-line no-undef
window.mR = moduleRaid();
window.Store = window.mR.findModule('Chat')[0].default;
window.Store.AppState = window.mR.findModule('STREAM')[0].default;
window.Store.Conn = window.mR.findModule('Conn')[0].default;
window.Store = Object.assign({}, window.mR.findModule('Chat')[0].default);
window.Store.AppState = window.mR.findModule('STREAM')[0].Socket;
window.Store.Conn = window.mR.findModule('Conn')[0].Conn;
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
window.Store.Wap = window.mR.findModule('Wap')[0].default;
window.Store.SendSeen = window.mR.findModule('sendSeen')[0];
window.Store.SendClear = window.mR.findModule('sendClear')[0];
window.Store.SendDelete = window.mR.findModule('sendDelete')[0];
window.Store.genId = window.mR.findModule('randomId')[0].default;
window.Store.genId = window.mR.findModule('randomId')[0].randomId;
window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0];
window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default;
window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0];
Expand All @@ -36,8 +36,8 @@ exports.ExposeStore = (moduleRaidStr) => {
window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].default;
window.Store.QueryOrder = window.mR.findModule('queryOrder')[0];
window.Store.QueryProduct = window.mR.findModule('queryProduct')[0];
window.Store.DownloadManager = window.mR.findModule('DownloadManager')[0].default;
window.Store.Call = window.mR.findModule('CallCollection')[0].default;
window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager;
window.Store.Call = window.mR.findModule('CallCollection')[0].CallCollection;

if(!window.Store.Chat._find) {
window.Store.Chat._find = e => {
Expand Down

0 comments on commit 3958105

Please sign in to comment.