doSend function

Last updated: 2026-03-04T23:36:57.288Z

Metrics

LOC: 19 Complexity: 3 Params: 1

Signature

doSend( message: import("@/types").ExtensionMessage, btn: HTMLButtonElement, originalText: string, ): : Promise<void>

Source Code

async function doSend(
  message: import("@/types").ExtensionMessage,
  btn: HTMLButtonElement,
  originalText: string,
): Promise<void> {
  btn.disabled = true;
  try {
    const result = await sendToActiveTab(message);
    const res = result as { filled?: number } | null;
    const count = res?.filled ?? 0;
    showStatus(`✓ ${count} ${t("filled")}`);
  } catch (err) {
    log.warn("Failed to send message:", err);
    showStatus(t("error"), true);
  } finally {
    btn.disabled = false;
    btn.textContent = originalText;
  }
}

Dependencies (Outgoing)

graph LR doSend["doSend"] sendToActiveTab["sendToActiveTab"] showStatus["showStatus"] doSend -->|calls| sendToActiveTab doSend -->|calls| showStatus style doSend fill:#dbeafe,stroke:#2563eb,stroke-width:2px click doSend "a64fadbf3863fefa.html" click sendToActiveTab "254b076f978b2286.html" click showStatus "2aab6178fa5261e5.html"
TargetType
sendToActiveTab calls
showStatus calls

Impact (Incoming)

graph LR doSend["doSend"] bindHandlers["bindHandlers"] bindHandlers -->|calls| doSend style doSend fill:#dbeafe,stroke:#2563eb,stroke-width:2px click doSend "a64fadbf3863fefa.html" click bindHandlers "e0addfeca217a6b2.html"
SourceType
bindHandlers calls