From 782e7b36691a3fab17285d3ccd5f450d00d90c31 Mon Sep 17 00:00:00 2001 From: Oleh Bespalov Date: Tue, 4 Mar 2025 13:31:41 +0100 Subject: [PATCH] Fix: unable to delete unread conversation --- bulkDeleteConversations.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bulkDeleteConversations.js b/bulkDeleteConversations.js index f4cb21e..f7bff86 100644 --- a/bulkDeleteConversations.js +++ b/bulkDeleteConversations.js @@ -62,17 +62,15 @@ async function deleteConversation(checkbox) { console.log("conversationElement", conversationElement); - // Look for hoverable element within the conversation element - const hoverableDiv = conversationElement.querySelector( - "div.can-hover\\:group-hover\\:visible" - ); - if (!hoverableDiv) { - console.log("Skipping conversation - no hoverable element found"); + // Look for draggable element within the conversation element + const draggableElement = conversationElement.querySelector("[draggable=\"true\"]"); + if (!draggableElement) { + 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 delete unread conversation: "${title}".`); + alert(`Unable to delete the conversation: "${title}".`); return false; } @@ -83,7 +81,7 @@ async function deleteConversation(checkbox) { }); console.log("1. Hovering over conversation...", conversationElement); - conversationElement.dispatchEvent(hoverEvent); + draggableElement.dispatchEvent(hoverEvent); await delay(200); // Try to find the three dot button