testversand

This commit is contained in:
2026-02-24 01:42:30 +01:00
parent 6f7ac43a0b
commit 8801a8ba32
2 changed files with 7 additions and 5 deletions

View File

@@ -1293,8 +1293,9 @@ export function initEditor() {
    prevDlg?.showModal?.();     prevDlg?.showModal?.();
  }   }
     
  async function openSend(ctx = null) {   async function openSend(ctx = null, sectionOverride = null) {
if (!current?.section?.is_template) { const sectionCtx = sectionOverride || current?.section || window.__activeSection || null;
if (!sectionCtx?.is_template) {
err('Kein Template geladen'); err('Kein Template geladen');
return; return;
} }
@@ -1537,13 +1538,14 @@ export function initEditor() {
err('Testversand: Keine ID vorhanden'); err('Testversand: Keine ID vorhanden');
return; return;
} }
if (!current?.section?.is_template) { const sectionCtx = opts.section || window.__activeSection || current?.section || null;
if (!sectionCtx?.is_template) {
err('Kein Template geladen'); err('Kein Template geladen');
return; return;
} }
window.__currentItemId = targetId; window.__currentItemId = targetId;
setSendContext(targetId, opts.name || ''); setSendContext(targetId, opts.name || '');
openSend({ id: targetId, name: opts.name || '' }); openSend({ id: targetId, name: opts.name || '' }, sectionCtx);
}; };
  // Public API   // Public API

View File

@@ -649,7 +649,7 @@ export async function loadList(section) {
return; return;
} }
if (window.AdminTestSend && typeof window.AdminTestSend.open === 'function') { if (window.AdminTestSend && typeof window.AdminTestSend.open === 'function') {
window.AdminTestSend.open({ id, name: nm }); window.AdminTestSend.open({ id, name: nm, section });
} else { } else {
toast('Testversand ist aktuell nicht verfügbar.', false); toast('Testversand ist aktuell nicht verfügbar.', false);
} }