Fix API change window.store removal (#117)

window.Store was removed from whatsapp web. This piece of code was using it still.
I was now getting hit with it once #104 was merged, although I'm not sure why I wasn't earlier.

This might be a bigger issue that needs addressing here, or something that depends on whatsapp web js version

Co-authored-by: nir <nir@severin>
This commit is contained in:
Nir 2026-03-09 09:38:03 +02:00 • committed by GitHub
commit 283b1dfb8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,7 +109,8 @@ const patchWWebLibrary = async (client) => {
if (searchOptions && searchOptions.limit > 0) { if (searchOptions && searchOptions.limit > 0) {
while (msgs.length < searchOptions.limit) { while (msgs.length < searchOptions.limit) {
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat) const loadedMessages = await (window.require('WAWebChatLoadMessages')).loadEarlierMsgs(chat);
if (!loadedMessages || !loadedMessages.length) break if (!loadedMessages || !loadedMessages.length) break
msgs = [...loadedMessages.filter(msgFilter), ...msgs] msgs = [...loadedMessages.filter(msgFilter), ...msgs]
} }