From a86990fc5804e1b23e38c6ddfe6898ce7dd7ab7d Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Wed, 10 Jun 2026 23:31:23 +0900 Subject: [PATCH] Email row: fix crash from leftover menu-wrap wiring after button removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I removed the .email-menu-wrap markup from email rows earlier but left the JS that queries it and calls .addEventListener on the result. Since the query returns null, every _createEmailItem call threw and the row never made it into the list — most visibly: clicking a sender name to filter by them didn't appear to work, because the row wiring (including the sender click handler) was ripped out mid-construction. - Drop the unconditional menuWrap.addEventListener('click', ...) block — there's no menu to open. - Drop the early-return guard on touchstart that referenced the removed wrap. - The two remaining .email-menu-wrap queries are already guarded with 'if (menuWrap)' so they safely no-op. --- static/js/emailInbox.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/static/js/emailInbox.js b/static/js/emailInbox.js index a07ed0c9e..6278574d1 100644 --- a/static/js/emailInbox.js +++ b/static/js/emailInbox.js @@ -562,17 +562,10 @@ function _createEmailItem(em) { // Click to open — do NOT close sidebar item.addEventListener('click', (e) => { - if (e.target.closest('.email-menu-wrap')) return; if (item.dataset.swipeBlock === '1') return; _openEmail(em, item); }); - const menuWrap = item.querySelector('.email-menu-wrap'); - menuWrap.addEventListener('click', (e) => { - e.stopPropagation(); - _showEmailMenu(em, menuWrap, item); - }); - // Swipe left to archive (mobile). Mirrors sidebar-layout.js swipe pattern. if ('ontouchstart' in window) { let startX = 0, startY = 0, dx = 0, dy = 0, swiping = false, swiped = false; @@ -580,7 +573,6 @@ function _createEmailItem(em) { const VERT_CANCEL = 30; // px vertical motion cancels swipe (treat as scroll) item.addEventListener('touchstart', (e) => { - if (e.target.closest('.email-menu-wrap')) return; const t = e.touches[0]; startX = t.clientX; startY = t.clientY; dx = 0; dy = 0; swiping = true; swiped = false;