File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -416,8 +416,8 @@ export async function notifyEarner (userId, earnings) {
416
416
if ( earnings . COMMENT ) body += `#${ earnings . COMMENT . bestRank } among comments with ${ fmt ( earnings . COMMENT . msats ) } in total\n`
417
417
if ( earnings . TIP_POST ) body += `#${ earnings . TIP_POST . bestRank } in post zapping with ${ fmt ( earnings . TIP_POST . msats ) } in total\n`
418
418
if ( earnings . TIP_COMMENT ) body += `#${ earnings . TIP_COMMENT . bestRank } in comment zapping with ${ fmt ( earnings . TIP_COMMENT . msats ) } in total\n`
419
- if ( earnings . FOREVER_REFERRAL ) body += `# ${ earnings . FOREVER_REFERRAL . bestRank } in referral rewards with ${ fmt ( earnings . FOREVER_REFERRAL . msats ) } in total\n`
420
- if ( earnings . ONE_DAY_REFERRAL ) body += `# ${ earnings . ONE_DAY_REFERRAL . bestRank } in referral rewards with ${ fmt ( earnings . ONE_DAY_REFERRAL . msats ) } in total`
419
+ if ( earnings . ONE_DAY_REFERRAL ) body += `in referral rewards with ${ fmt ( earnings . ONE_DAY_REFERRAL ) } in total\n`
420
+ if ( earnings . FOREVER_REFERRAL ) body += `in lifetime referral rewards with ${ fmt ( earnings . FOREVER_REFERRAL . msats ) } in total`
421
421
422
422
try {
423
423
await sendUserNotification ( userId , { title, tag, body } )
Original file line number Diff line number Diff line change @@ -149,6 +149,14 @@ export async function earn ({ name }) {
149
149
type : 'FOREVER_REFERRAL' ,
150
150
rank : earner . rank
151
151
} , { models } ) )
152
+
153
+ const userN = notifications [ earner . foreverReferrerId ] || { }
154
+ const prevMsats = userN . msats || 0
155
+ const msats = foreverReferrerEarnings + prevMsats
156
+ notifications [ earner . foreverReferrerId ] = {
157
+ ...userN ,
158
+ FOREVER_REFERRAL : msats
159
+ }
152
160
} else if ( earner . oneDayReferrerId ) {
153
161
// if the person doesn't have a forever referrer yet, they give double to their one day referrer
154
162
oneDayReferrerEarnings += foreverReferrerEarnings
@@ -162,6 +170,14 @@ export async function earn ({ name }) {
162
170
type : 'ONE_DAY_REFERRAL' ,
163
171
rank : earner . rank
164
172
} , { models } ) )
173
+
174
+ const userN = notifications [ earner . oneDayReferrerId ] || { }
175
+ const prevMsats = userN . msats || 0
176
+ const msats = oneDayReferrerEarnings + prevMsats
177
+ notifications [ earner . oneDayReferrerId ] = {
178
+ ...userN ,
179
+ ONE_DAY_REFERRAL : msats
180
+ }
165
181
}
166
182
}
167
183
You can’t perform that action at this time.
0 commit comments