fix(send-po-modal): seed default body when resend has no prior email_payload
Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
parent
abdc3a4d9f
commit
add7ab3302
1 changed files with 6 additions and 6 deletions
|
|
@ -92,12 +92,12 @@ export function SendPoModal({ open, purchaseOrder, onClose, onSent }: Props) {
|
|||
setSubject(`Purchase Order ${po.po_number}`);
|
||||
setMessage("");
|
||||
}
|
||||
// Phase 2: async default-body seed. SKIPPED on the resend flow — the
|
||||
// operator's previous bodyText is already prefilled in phase 1 above
|
||||
// and we mustn't clobber it with the generic template once the fetch
|
||||
// resolves. Phase 2 also gates messageLoading so the textarea doesn't
|
||||
// grey out mid-edit on resend.
|
||||
if (!isResendFlow) {
|
||||
// Phase 2: async default-body seed. Skip only when the resend flow has a
|
||||
// previous body to preserve so the generic template doesn't clobber it.
|
||||
// If there is nothing to preserve (for example, a legacy sent PO without
|
||||
// email_payload), fall back to the default body. Phase 2 also gates
|
||||
// messageLoading so the textarea doesn't grey out mid-edit on resend.
|
||||
if (!isResendFlow || !previous) {
|
||||
setMessageLoading(true);
|
||||
(async () => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue