diff --git a/public/assets/my.js b/public/assets/my.js
index 012a76b..a0e8cfa 100644
--- a/public/assets/my.js
+++ b/public/assets/my.js
@@ -335,8 +335,8 @@
const chip = (m, q) => '' + esc(String(m.name || 'M').replace(/^@/, '').slice(0, 12)) + '';
const rowFor = lvl => {
const L = levels.find(x => x.level === lvl); const members = L ? L.members : [];
- const qn = lvl === 1 ? (buyerCount || 0) : 0; // highlight your qualified directs
- let html = members.map((m, i) => chip(m, i < qn)).join('');
+ // gold = the contract counted this member as one of your qualifying buyers (not "the first N chips")
+ let html = members.map(m => chip(m, !!m.qualified)).join('');
if (lvl <= 2 && members.length < (lvl === 1 ? 2 : 4)) html += '+ open';
if (!html) html = '+ open';
return '
';
diff --git a/public/my.html b/public/my.html
index 84dfbe3..62dadcd 100644
--- a/public/my.html
+++ b/public/my.html
@@ -234,6 +234,7 @@
Your line at a glance
+
name qualifying buyer: bought a $20+ package, counts toward your levels · name joined, no $20+ buy yet · + open spot still open
Your achievements
unlock as you build
diff --git a/server.js b/server.js
index 1d065a6..a576e0d 100644
--- a/server.js
+++ b/server.js
@@ -1234,10 +1234,12 @@ const server = http.createServer(async (req, res) => {
const own = (await accounts.positions(s.email)).filter(p => p.memberId);
const myIds = new Set([myId, ...own.map(p => p.memberId)].filter(Boolean));
const earnedBy = {};
+ const qualified = new Set(); // members the contract counted as this account's qualifying buyers ($20+)
if (myIds.size) {
for (const ev of chain.recentEvents(1e9)) {
if (ev.type === 'TierPaid' && myIds.has(ev.recipientId) && ev.buyerId)
earnedBy[ev.buyerId] = (BigInt(earnedBy[ev.buyerId] || '0') + BigInt(ev.amountWei)).toString();
+ if (ev.type === 'BuyerCounted' && myIds.has(ev.sponsorId) && ev.newBuyerId) qualified.add(ev.newBuyerId);
}
}
const out = levels.map(L => ({ level: L.level, members: L.members.map(m => ({
@@ -1245,6 +1247,7 @@ const server = http.createServer(async (req, res) => {
name: m.username ? '@' + m.username : m.memberId ? 'member #' + m.memberId : 'member',
email: L.level === 1 ? m.email : null, // directs only
joined: m.created,
+ qualified: !!(m.memberId && qualified.has(m.memberId)),
earnedWei: (m.memberId && earnedBy[m.memberId]) || '0' })) }));
// the member's own linked positions sit on level 1 too, labelled as theirs
if (own.length) {