fix: openChatWindowAt function (#3347)

* refactor: export the whole module, not a very single function

* fix: fix openChatWindowAt function
This commit is contained in:
alechkos 2025-05-30 14:32:53 +03:00 • committed by GitHub
commit 90b71cc6d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -84,7 +84,7 @@ exports.ExposeStore = () => {
window.Store.LinkPreview = window.require('WAWebLinkPreviewChatAction'); window.Store.LinkPreview = window.require('WAWebLinkPreviewChatAction');
window.Store.Socket = window.require('WADeprecatedSendIq'); window.Store.Socket = window.require('WADeprecatedSendIq');
window.Store.SocketWap = window.require('WAWap'); 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.DrawerManager = window.require('WAWebDrawerManager').DrawerManager;
window.Store.LidUtils = window.require('WAWebApiContact'); window.Store.LidUtils = window.require('WAWebApiContact');
window.Store.WidToJid = window.require('WAWebWidToJid'); window.Store.WidToJid = window.require('WAWebWidToJid');

View file

@ -48,11 +48,11 @@ class InterfaceController {
* @param {string} msgId ID of the message that will be scrolled to * @param {string} msgId ID of the message that will be scrolled to
*/ */
async openChatWindowAt(msgId) { 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]; 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); const chat = window.Store.Chat.get(msg.id.remote) ?? await window.Store.Chat.find(msg.id.remote);
let searchContext = await window.Store.SearchContext(chat,msg); const searchContext = await window.Store.SearchContext.getSearchContext(chat, msg.id);
await window.Store.Cmd.openChatAt(chat, searchContext); await window.Store.Cmd.openChatAt({ chat: chat, msgContext: searchContext });
}, msgId); }, msgId);
} }