From 283b1dfb8c997f4e9e389d5d3f5647e61f9b08bb Mon Sep 17 00:00:00 2001 From: Nir Date: Mon, 9 Mar 2026 09:38:03 +0200 Subject: [PATCH] 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 --- src/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index fae04ea..3100c07 100644 --- a/src/utils.js +++ b/src/utils.js @@ -109,7 +109,8 @@ const patchWWebLibrary = async (client) => { if (searchOptions && searchOptions.limit > 0) { 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 msgs = [...loadedMessages.filter(msgFilter), ...msgs] }