Skip to content

Commit c01a803

Browse files
committed
fix domjudge balloon
1 parent 71942f4 commit c01a803

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/server/client/balloon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ let printer: string = null;
9191
async 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(

packages/server/service/fetcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)