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:
parent
073eff93a2
commit
283b1dfb8c
1 changed files with 2 additions and 1 deletions
|
|
@ -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]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue