Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: openChatWindowAt function #3347

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/util/Injected/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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');
Expand Down
8 changes: 4 additions & 4 deletions src/util/InterfaceController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading