From c7fdeea1422e7ab85e0e63350fe50d608b35bd0b Mon Sep 17 00:00:00 2001 From: qcrao Date: Wed, 5 Mar 2025 15:15:41 +0800 Subject: [PATCH] fix archive --- bulkArchiveConversations.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bulkArchiveConversations.js b/bulkArchiveConversations.js index d4997d2..b84fa69 100644 --- a/bulkArchiveConversations.js +++ b/bulkArchiveConversations.js @@ -49,7 +49,19 @@ async function archiveConversation(checkbox) { }); console.log("1. Hovering over conversation...", conversationElement); - conversationElement.dispatchEvent(hoverEvent); + + const interactiveElement = conversationElement.querySelector("[draggable=\"true\"]"); + if (!interactiveElement) { + console.log("Skipping conversation - no interactive elements found"); + // Show notification to user + const title = + conversationElement.querySelector(Selectors.TITLE_SELECTOR) + ?.textContent || "this conversation"; + alert(`Unable to archive the conversation: "${title}".`); + return false; + } + + interactiveElement.dispatchEvent(hoverEvent); await delay(200); const pointerDownEvent = new PointerEvent("pointerdown", {