Make bonus rules visible: highlighted BONUS line on the alerts overlay, streamgoals_bonus action
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1e2ca96eed
commit
c7f2dcffeb
9 files changed
+187
-3
No files matched your search
@@ -26,7 +26,13 @@ final class OverlayService {
|
||||
$c = $gid ? $this->source->counter( $gid ) : array( 'label' => '', 'value' => 0 );
|
||||
return Payloads::counter( $c['label'], $c['value'] );
|
||||
case 'alerts':
|
||||
return Payloads::alerts( $this->source->donations( $since, 20 ), $since );
|
||||
$rows = $this->source->donations( $since, 20 );
|
||||
$ids = array_values( array_filter( array_map( static fn( $r ) => (int) ( $r['id'] ?? 0 ), $rows ) ) );
|
||||
$bonuses = ( null !== $since && $ids ) ? $this->source->bonusesFor( $ids ) : array();
|
||||
foreach ( $rows as $i => $r ) {
|
||||
$rows[ $i ]['bonuses'] = $bonuses[ (int) ( $r['id'] ?? 0 ) ] ?? array();
|
||||
}
|
||||
return Payloads::alerts( $rows, $since );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user