fix: msg.chat (#2139)

* fix function openChatWindowAt

* fix star \ unstar

* fix function delete

* fix closeRightDrawer
This commit is contained in:
tofers 2023-04-19 02:50:08 +03:00 • committed by GitHub
commit 37724f6959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 11 deletions

View file

@ -54,6 +54,8 @@ exports.ExposeStore = (moduleRaidStr) => {
window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0];
window.Store.Socket = window.mR.findModule('deprecatedSendIq')[0];
window.Store.SocketWap = window.mR.findModule('wap')[0];
window.Store.SearchContext = window.mR.findModule('getSearchContext')[0].getSearchContext;
window.Store.DrawerManager = window.mR.findModule('DrawerManager')[0].DrawerManager;
window.Store.StickerTools = {
...window.mR.findModule('toWebpSticker')[0],
...window.mR.findModule('addWebpMetadata')[0]

View file

@ -50,7 +50,9 @@ class InterfaceController {
async openChatWindowAt(msgId) {
await this.pupPage.evaluate(async msgId => {
let msg = await window.Store.Msg.get(msgId);
await window.Store.Cmd.openChatAt(msg.chat, msg.chat.getSearchContext(msg));
let chat = await window.Store.Chat.find(msg.id.remote);
let searchContext = await window.Store.SearchContext(chat,msg);
await window.Store.Cmd.openChatAt(chat, searchContext);
}, msgId);
}
@ -70,7 +72,7 @@ class InterfaceController {
*/
async closeRightDrawer() {
await this.pupPage.evaluate(async () => {
await window.Store.Cmd.closeDrawerRight();
await window.Store.DrawerManager.closeDrawerRight();
});
}