Skip to content

Commit 10eade4

Browse files
authored
Merge pull request #35 from devicecloud-dev/fix/quiet-suppress-refresh-countdown
fix: suppress refresh countdown in quiet mode
2 parents f77841f + d543981 commit 10eade4

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/services/results-polling.service.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export class ResultsPollingService {
166166
realtimeEnabled,
167167
subscription?.isConnected() ?? false,
168168
nextPollAt,
169+
quiet,
169170
);
170171
ux.action.status = footer ? `${statusBody}\n${footer}` : statusBody;
171172
};
@@ -644,12 +645,13 @@ export class ResultsPollingService {
644645
* Build the live footer shown under the status display: whether realtime
645646
* updates are connected (for logged-in users) and how long until the next
646647
* backstop poll. While a fetch is in flight (`nextPollAt` is null) the
647-
* countdown reads "refreshing…".
648+
* countdown reads "refreshing…". In quiet mode the countdown is omitted.
648649
*/
649650
private buildStatusFooter(
650651
realtimeEnabled: boolean,
651652
realtimeConnected: boolean,
652653
nextPollAt: null | number,
654+
quiet: boolean,
653655
): string {
654656
const parts: string[] = [];
655657

@@ -661,11 +663,15 @@ export class ResultsPollingService {
661663
);
662664
}
663665

664-
if (nextPollAt === null) {
665-
parts.push(colors.dim('refreshing…'));
666-
} else {
667-
const secondsLeft = Math.max(0, Math.ceil((nextPollAt - Date.now()) / 1000));
668-
parts.push(colors.dim(`next refresh in ${secondsLeft}s`));
666+
// The countdown to the next backstop poll is noise in quiet mode (geared at
667+
// CI), so suppress it there while keeping the realtime indicator.
668+
if (!quiet) {
669+
if (nextPollAt === null) {
670+
parts.push(colors.dim('refreshing…'));
671+
} else {
672+
const secondsLeft = Math.max(0, Math.ceil((nextPollAt - Date.now()) / 1000));
673+
parts.push(colors.dim(`next refresh in ${secondsLeft}s`));
674+
}
669675
}
670676

671677
return parts.join(colors.dim(' · '));

0 commit comments

Comments
 (0)