File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ let printer: string = null;
9191async function printBalloon ( doc , lang ) {
9292 let status = '' ;
9393 for ( const i in doc . total ) {
94- status += `- ${ i } : ${ getBalloonName ( doc . total [ i ] . color , lang ) } \n` ;
94+ status += `- ${ i } : ${ doc . total [ i ] . color || getBalloonName ( doc . total [ i ] . rgb , lang ) } \n` ;
9595 }
9696 const genText = config . balloonType === 'plain' ? plainBalloonText : receiptBalloonText ;
9797 const bReceipt = await genText (
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ class DOMjudgeFetcher extends BasicFetcher {
137137 if ( all ) this . logger . info ( 'Sync all balloons...' ) ;
138138 const { body } = await fetch ( `./api/v4/contests/${ this . contest . id } /balloons?todo=${ all ? 'false' : 'true' } ` ) ;
139139 if ( ! body || ! body . length ) return ;
140- const balloons = body ;
140+ const balloons = body . sort ( ( a , b ) => a . time - b . time ) ;
141141 for ( const balloon of balloons ) {
142142 const teamTotal = await this . ctx . db . balloon . find ( { teamid : balloon . teamid , time : { $lt : ( balloon . time * 1000 ) . toFixed ( 0 ) } } ) ;
143143 const encourage = teamTotal . length < ( config . freezeEncourage ?? 0 ) ;
You can’t perform that action at this time.
0 commit comments