@bobfrankston/rmfmail 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2440,12 +2440,14 @@ async function refreshPriorityIndex() {
2440
2440
  function rowKey(accountId, uid) {
2441
2441
  return `${accountId}:${uid}`;
2442
2442
  }
2443
- function focusRow(row) {
2443
+ function focusRow(row, opts = {}) {
2444
2444
  if (focusedRow && focusedRow !== row)
2445
2445
  focusedRow.setSelected(false);
2446
2446
  row.setSelected(true);
2447
2447
  focusedRow = row;
2448
- row.el.scrollIntoView({ block: "nearest" });
2448
+ if (opts.scroll !== false) {
2449
+ row.el.scrollIntoView({ block: "nearest" });
2450
+ }
2449
2451
  showMessage(row.accountId, row.msg.uid, row.msg.folderId, currentSpecialUse || void 0, false, row.msg);
2450
2452
  onMessageSelect(row.accountId, row.msg.uid, row.msg.folderId);
2451
2453
  document.dispatchEvent(new CustomEvent("mailx-focus-changed", { detail: row.msg }));
@@ -2454,11 +2456,11 @@ function focusRow(row) {
2454
2456
  function getCurrentFocused() {
2455
2457
  return focusedRow ? focusedRow.msg : null;
2456
2458
  }
2457
- function focusByIdentity(accountId, uid) {
2459
+ function focusByIdentity(accountId, uid, opts = {}) {
2458
2460
  const row = rowByKey.get(rowKey(accountId, uid));
2459
2461
  if (!row)
2460
2462
  return false;
2461
- focusRow(row);
2463
+ focusRow(row, opts);
2462
2464
  return true;
2463
2465
  }
2464
2466
  function setRowFlagged(accountId, uid, yes) {
@@ -2954,7 +2956,7 @@ function restoreSelection(body, savedUid) {
2954
2956
  return;
2955
2957
  const accountId = body.querySelector(`.ml-row[data-uid="${savedUid}"]`)?.dataset.accountId;
2956
2958
  if (accountId) {
2957
- focusByIdentity(accountId, Number(savedUid));
2959
+ focusByIdentity(accountId, Number(savedUid), { scroll: false });
2958
2960
  }
2959
2961
  }
2960
2962
  async function showThreadPopup(pillEl, headMsg) {