mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-15 17:25:26 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user