diff --git a/src/util/Injected/Store.js b/src/util/Injected/Store.js index d9ef224..a2a444b 100644 --- a/src/util/Injected/Store.js +++ b/src/util/Injected/Store.js @@ -84,7 +84,7 @@ exports.ExposeStore = () => { window.Store.LinkPreview = window.require('WAWebLinkPreviewChatAction'); window.Store.Socket = window.require('WADeprecatedSendIq'); window.Store.SocketWap = window.require('WAWap'); - window.Store.SearchContext = window.require('WAWebChatMessageSearch').getSearchContext; + window.Store.SearchContext = window.require('WAWebChatMessageSearch'); window.Store.DrawerManager = window.require('WAWebDrawerManager').DrawerManager; window.Store.LidUtils = window.require('WAWebApiContact'); window.Store.WidToJid = window.require('WAWebWidToJid'); diff --git a/src/util/InterfaceController.js b/src/util/InterfaceController.js index 1f38931..9bab2ca 100644 --- a/src/util/InterfaceController.js +++ b/src/util/InterfaceController.js @@ -48,11 +48,11 @@ class InterfaceController { * @param {string} msgId ID of the message that will be scrolled to */ async openChatWindowAt(msgId) { - await this.pupPage.evaluate(async msgId => { + await this.pupPage.evaluate(async (msgId) => { const msg = window.Store.Msg.get(msgId) || (await window.Store.Msg.getMessagesById([msgId]))?.messages?.[0]; - 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); + const chat = window.Store.Chat.get(msg.id.remote) ?? await window.Store.Chat.find(msg.id.remote); + const searchContext = await window.Store.SearchContext.getSearchContext(chat, msg.id); + await window.Store.Cmd.openChatAt({ chat: chat, msgContext: searchContext }); }, msgId); }