Fix: extract interactive selector to globals

This commit is contained in:
Oleh Bespalov
2025-04-20 23:30:54 +02:00
parent c828d41c5e
commit 4db9a1a518
3 changed files with 3 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ async function archiveConversation(checkbox) {
console.log("1. Hovering over conversation...", conversationElement); console.log("1. Hovering over conversation...", conversationElement);
const interactiveElement = conversationElement.querySelector("[draggable]"); const interactiveElement = conversationElement.querySelector(Selectors.INTERACTIVE_ELEMENT_SELECTOR);
if (!interactiveElement) { if (!interactiveElement) {
console.log("Skipping conversation - no interactive elements found"); console.log("Skipping conversation - no interactive elements found");
// Show notification to user // Show notification to user

View File

@@ -63,7 +63,7 @@ async function deleteConversation(checkbox) {
console.log("conversationElement", conversationElement); console.log("conversationElement", conversationElement);
// Look for interactive element within the conversation element // Look for interactive element within the conversation element
const interactiveElement = conversationElement.querySelector("[draggable]"); const interactiveElement = conversationElement.querySelector(Selectors.INTERACTIVE_ELEMENT_SELECTOR);
if (!interactiveElement) { if (!interactiveElement) {
console.log("Skipping conversation - no interactive elements found"); console.log("Skipping conversation - no interactive elements found");
// Show notification to user // Show notification to user

View File

@@ -12,6 +12,7 @@ if (typeof window.globalsLoaded === "undefined") {
CONVERSATION_SELECTOR: 'li[data-testid^="history-item-"]', CONVERSATION_SELECTOR: 'li[data-testid^="history-item-"]',
// 更新标题选择器,保持相对路径 // 更新标题选择器,保持相对路径
TITLE_SELECTOR: ".relative.grow.overflow-hidden.whitespace-nowrap", TITLE_SELECTOR: ".relative.grow.overflow-hidden.whitespace-nowrap",
INTERACTIVE_ELEMENT_SELECTOR: '[draggable]',
}; };
// Constants // Constants