Dashboard: community toasts for joins, tank arrivals, adoptions, purchases, payouts and qualifications

A second, quieter toast (bottom-left, one per 4 s) shows site-wide activity from the
live feed for every signed-in member; personal payout toasts are unchanged. The server
pushes Joined (at first username, with tank flag) and Adopted events onto the feed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-12 16:03:43 -05:00
parent a9f10f861d
commit 6395ad3a7e
3 changed files with 31 additions and 2 deletions
+3
View File
@@ -1130,6 +1130,7 @@ const server = http.createServer(async (req, res) => {
const b = await readBody(req);
const r = await tank.adopt(s.email, b.who, b.note);
if (r.ok) { // tell the payments topic who picked whom up (Marty, 2026-09-12)
pushFeed({ type: 'Adopted', sponsor: r.adopterName, member: r.adopteeName, ts: Date.now() });
try {
const sc = siteConfig();
const clean = t => String(t || '').replace(/[<>&]/g, '');
@@ -1235,6 +1236,8 @@ const server = http.createServer(async (req, res) => {
if (!r.error && before && !before.username && b.username) {
const acct = await accounts.byEmail(s.email);
notifyNewReferral(acct && acct.sponsorRef, acct).catch(() => {});
// everyone's dashboard: "@name just joined" (and whether they are waiting in the tank)
if (acct && acct.username) pushFeed({ type: 'Joined', name: '@' + acct.username, tank: !acct.sponsorRef && !acct.memberId, ts: Date.now() });
}
return json(res, r.error ? 400 : 200, r);
}