eleven / messenger Public

admin: fix create-admin-invite silently failing (#409) (#419)

The confirm button in the admin-invite dialog called flash(), a
const that only exists inside wireUpdates()'s closure, targeting a
delegateStatus element that doesn't exist in admin.html. That threw
a ReferenceError right after the warning modal closed, so mintInvite
never ran and the invite/QR modal never appeared — the dialog just
showed the warning and dismissed.
Co-authored-by: Claude <noreply@anthropic.com>
James Adam 6d410586282c51929c56f25bd26720445700f4d6 parent 2a6ba19
1 file changed, +1 −3
  • web/static/admin.js +1 −3
diff --git a/web/static/admin.js b/web/static/admin.js
index 502ceeb..7996e72 100644
--- a/web/static/admin.js
+++ b/web/static/admin.js
@@ -446,10 +446,8 @@ function showAdminConfirmation(label) {
confirmBtn.textContent = "Create invite";
confirmBtn.onclick = async () => {
backdrop.remove();
- confirmBtn.disabled = true;
- flash(document.getElementById("delegateStatus"), "Creating invite…");
+ toast("Creating invite…");
const minted = await mintInvite(label, null, false, null, true);
- confirmBtn.disabled = false;
if (!minted) return;
document.getElementById("adminLabel").value = "";
showInviteModal(minted.link, label ? `Admin invite for ${label}` : "Admin invite", true);