@bobfrankston/rmfmail 1.2.133 → 1.2.136

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.
@@ -5098,6 +5098,33 @@ document.getElementById("btn-send")?.addEventListener("click", async () => {
5098
5098
  }
5099
5099
  const sendStart = Date.now();
5100
5100
  logClientEvent("compose-send-pre-ipc");
5101
+ if (popoutInitId) {
5102
+ const sendBtn = document.getElementById("btn-send");
5103
+ if (sendBtn) {
5104
+ sendBtn.disabled = true;
5105
+ sendBtn.textContent = "Sending\u2026";
5106
+ }
5107
+ try {
5108
+ await sendMessage(body);
5109
+ logClientEvent("compose-send-ipc-resolved", { via: "popout-rpc", ms: Date.now() - sendStart });
5110
+ } catch (e) {
5111
+ const msg = e?.message || String(e);
5112
+ logClientEvent("compose-send-ipc-rejected", { via: "popout-rpc", error: msg, ms: Date.now() - sendStart });
5113
+ if (sendBtn) {
5114
+ sendBtn.disabled = false;
5115
+ sendBtn.textContent = "Send";
5116
+ }
5117
+ if (!draftTimer) draftTimer = setInterval(saveDraft2, DRAFT_INTERVAL_MS);
5118
+ const statusEl = document.getElementById("compose-status");
5119
+ if (statusEl) {
5120
+ statusEl.textContent = `Send failed: ${msg}`;
5121
+ statusEl.classList.add("compose-status-error");
5122
+ } else alert(`Send failed: ${msg}`);
5123
+ return;
5124
+ }
5125
+ closeCompose();
5126
+ return;
5127
+ }
5101
5128
  try {
5102
5129
  const reqId = `send-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
5103
5130
  const onMsg = (ev) => {