@bobfrankston/rmfmail 1.1.129 → 1.1.130

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.
package/client/app.js CHANGED
@@ -2246,16 +2246,37 @@ window.addEventListener("message", (e) => {
2246
2246
  if (e.data?.type === "mailx-compose-send" && e.data.id && e.data.body) {
2247
2247
  const src = e.source;
2248
2248
  const id = e.data.id;
2249
+ const body = e.data.body;
2249
2250
  logClientEvent("relay-compose-send-received", { id });
2251
+ // Drop the draft row from the list immediately on send-click. The
2252
+ // daemon-side deleteDraft local-row delete already fires + emits
2253
+ // folderCountsChanged, but that reload is debounced 2 s — long
2254
+ // enough that Bob saw "the draft is still there, did it send?".
2255
+ // Pre-empting the list now keeps the Drafts view honest the
2256
+ // moment Send is clicked.
2257
+ if (body.from && body.draftUid) {
2258
+ removeMessagesAndReconcile([{ accountId: body.from, uid: body.draftUid }]);
2259
+ }
2260
+ // Visible Sent confirmation in the status bar. The outbox-status
2261
+ // pill only shows while queued; for a fast send the pill never
2262
+ // appears and the user had nothing to confirm the click did
2263
+ // anything (Bob 2026-05-23: "There is no indication that it has
2264
+ // been sent").
2265
+ const statusSync = document.getElementById("status-sync");
2266
+ if (statusSync) {
2267
+ statusSync.textContent = `Sent ${new Date().toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit", hour12: false })}`;
2268
+ }
2250
2269
  (async () => {
2251
2270
  try {
2252
- await apiSendMessage(e.data.body);
2271
+ await apiSendMessage(body);
2253
2272
  logClientEvent("relay-compose-send-ok", { id });
2254
2273
  src?.postMessage({ type: "mailx-compose-send-result", id, ok: true }, "*");
2255
2274
  }
2256
2275
  catch (err) {
2257
2276
  const msg = err?.message || String(err);
2258
2277
  logClientEvent("relay-compose-send-error", { id, error: msg });
2278
+ if (statusSync)
2279
+ statusSync.textContent = `Send failed: ${msg}`;
2259
2280
  src?.postMessage({ type: "mailx-compose-send-result", id, ok: false, error: msg }, "*");
2260
2281
  }
2261
2282
  })();