@bobfrankston/mailx 1.0.409 → 1.0.411

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.
@@ -373,8 +373,8 @@ export async function showMessage(accountId, uid, folderId, specialUse, isRetry
373
373
  if (anyUrl) {
374
374
  unsubBtn.hidden = false;
375
375
  unsubBtn.textContent = oneClick && httpUrl ? "Unsubscribe (1-click)" : "Unsubscribe";
376
- unsubBtn.title = anyUrl;
377
- unsubBtn.href = "#";
376
+ unsubBtn.removeAttribute("title");
377
+ unsubBtn.href = httpUrl || mailUrl || "#";
378
378
  unsubBtn.onclick = async (e) => {
379
379
  e.preventDefault();
380
380
  const status = document.getElementById("status-sync");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.409",
3
+ "version": "1.0.411",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -278,11 +278,12 @@ export class MailxService {
278
278
  parseListUnsubscribe(parsed2.headers));
279
279
  listUnsubscribe = listUnsubscribeHttp || listUnsubscribeMail;
280
280
  }
281
- // EML path: read the real on-disk path from `envelope.bodyPath` (DB
282
- // is authoritative since v1.0.361 files are opaque UUIDs, not the
283
- // old {folderId}/{uid}.eml layout). Synthesizing the legacy path
284
- // here showed users a path that doesn't exist.
285
- const emlPath = envelope.bodyPath || "";
281
+ // EML path: re-read the row after the fetch `fetchMessageBody`
282
+ // writes the body to disk and updates `body_path` on success, but the
283
+ // `envelope` snapshot above pre-dates that write, so trusting it
284
+ // hides the Source button on every just-opened message.
285
+ const refreshed = this.db.getMessageByUid(accountId, uid, folderId);
286
+ const emlPath = refreshed?.bodyPath || envelope.bodyPath || "";
286
287
  return {
287
288
  ...envelope, bodyHtml, bodyText, hasRemoteContent, remoteAllowed: allowRemote,
288
289
  attachments, emlPath, deliveredTo, returnPath,