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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user