Matrix card: clear invite-confirmation UX when saving an external MXID

This commit is contained in:
inference-bot committed 2026-10-12 09:01:27 -06:00
1 parent 6627bf0793
commit 1242024cc7
1 file changed
+6 -1
+6 -1
View File
@@ -413,6 +413,7 @@ PAGE_HTML = """<!DOCTYPE html>
} }
.new-key input:focus { outline: none; border-color: var(--green-mid); } .new-key input:focus { outline: none; border-color: var(--green-mid); }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; } .hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.hint.ok { color: #2f5c30; }
.key-reveal { .key-reveal {
margin-top: 16px; padding: 16px; margin-top: 16px; padding: 16px;
background: #eaf3ea; border: 1px solid var(--green-mid); border-radius: 10px; background: #eaf3ea; border: 1px solid var(--green-mid); border-radius: 10px;
@@ -664,7 +665,11 @@ async function saveMxid() {
const d = await r.json(); const d = await r.json();
if (d.error) { $('mxid-status').textContent = d.error; } if (d.error) { $('mxid-status').textContent = d.error; }
else if (mxid) { else if (mxid) {
$('mxid-status').textContent = 'Saved — invitations will go to ' + mxid + '.'; const joined = d.invite_sent === false;
$('mxid-status').innerHTML = 'Saved. An invite to the co-op Matrix space is on its way to <strong>' + escapeHtml(mxid) + '</strong>' +
(joined ? ' — that account could not be reached right now; the nightly sync will retry automatically.' :
' — accept it from that account to join. Your co-op account will no longer receive invites.');
$('mxid-status').className = 'hint ok';
} else { } else {
$('mxid-status').textContent = 'Cleared — your co-op account will be used for Matrix.'; $('mxid-status').textContent = 'Cleared — your co-op account will be used for Matrix.';
$('mxid-input').value = ''; $('mxid-input').value = '';