Email row: fix crash from leftover menu-wrap wiring after button removal

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.
This commit is contained in:
pewdiepie-archdaemon
2026-06-10 23:31:23 +09:00
parent f4c1b264c6
commit a86990fc58
-8
View File
@@ -562,17 +562,10 @@ function _createEmailItem(em) {
// Click to open — do NOT close sidebar // Click to open — do NOT close sidebar
item.addEventListener('click', (e) => { item.addEventListener('click', (e) => {
if (e.target.closest('.email-menu-wrap')) return;
if (item.dataset.swipeBlock === '1') return; if (item.dataset.swipeBlock === '1') return;
_openEmail(em, item); _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. // Swipe left to archive (mobile). Mirrors sidebar-layout.js swipe pattern.
if ('ontouchstart' in window) { if ('ontouchstart' in window) {
let startX = 0, startY = 0, dx = 0, dy = 0, swiping = false, swiped = false; 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) const VERT_CANCEL = 30; // px vertical motion cancels swipe (treat as scroll)
item.addEventListener('touchstart', (e) => { item.addEventListener('touchstart', (e) => {
if (e.target.closest('.email-menu-wrap')) return;
const t = e.touches[0]; const t = e.touches[0];
startX = t.clientX; startY = t.clientY; startX = t.clientX; startY = t.clientY;
dx = 0; dy = 0; swiping = true; swiped = false; dx = 0; dy = 0; swiping = true; swiped = false;