Config-driven wallet-connect notice (for the Blockaid false-positive window)

New shared wallet-notice.js on join-now, my, training: if config.walletNotice
is set, shows an admin-authored heads-up right above every connect/unlock
button; empty string hides it everywhere (one PATCH, no deploy). Placed at the
friction point only, not a sitewide banner, so unaffected wallets/Mini App
users are not told about a warning they will never see.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-25 18:40:32 -05:00
parent 0ee7063a76
commit a413062c5c
5 changed files with 27 additions and 5 deletions
+22
View File
@@ -0,0 +1,22 @@
// Temporary, admin-controlled heads-up shown right above any wallet-connect
// button while a scanner false-positive is being cleared. Driven by
// config.walletNotice (admin PATCH): non-empty string = show it, ""/unset =
// nothing renders. One config flip removes it everywhere, no deploy.
(function () {
'use strict';
fetch('/api/public/config').then(function (r) { return r.json(); }).then(function (c) {
var msg = (c && c.walletNotice || '').trim();
if (!msg) return;
var btns = [].slice.call(document.querySelectorAll('button, a.btn'));
var targets = btns.filter(function (b) { return /connect|unlock/i.test(b.textContent || ''); });
if (!targets.length) return;
targets.forEach(function (btn) {
if (btn.dataset.wnDone) return; btn.dataset.wnDone = '1';
var n = document.createElement('div');
n.className = 'callout';
n.style.cssText = 'margin:0 0 12px;font-size:13px;line-height:1.5;border-color:rgba(243,190,67,.5)';
n.innerHTML = 'ℹ️ ' + msg; // admin-authored, same trust level as other config-injected copy
btn.parentNode.insertBefore(n, btn);
});
}).catch(function () {});
})();