fix(frontend): prefer canonical phase for client action gating
CI / test-and-quality (push) Successful in 2m56s
CI / test-and-quality (pull_request) Successful in 3m1s

This commit is contained in:
2026-03-16 17:00:02 +00:00
parent 112a85a22d
commit d9c4cda966
7 changed files with 175 additions and 26 deletions
@@ -95,7 +95,7 @@ function resolveLocalStorage(): Storage | undefined {
<button *ngIf="submitError?.kind === 'guess'" (click)="submitGuess()" [disabled]="loading || !canSubmitGuess">{{ copy('player.retry_guess_submit') }}</button>
</ng-container>
<div class="panel" *ngIf="session.reveal && (session.session.status === 'reveal' || session.session.status === 'scoreboard')">
<div class="panel" *ngIf="showRevealPanel">
<h3>Reveal</h3>
<p><strong>Korrekt svar:</strong> {{ session.reveal.correct_answer }}</p>
<p><strong>Spørgsmål:</strong> {{ session.reveal.prompt }}</p>
@@ -221,6 +221,10 @@ export class PlayerShellComponent implements OnInit, OnDestroy {
return isPlayerGameplayActionAllowed(this.session as any, 'submitGuess');
}
get showRevealPanel(): boolean {
return Boolean(this.session?.reveal && (this.gameplayPhase === 'reveal' || this.gameplayPhase === 'scoreboard'));
}
private readonly handleOnline = (): void => {
this.connectionState = 'reconnecting';
void this.retryReconnect();
@@ -469,7 +473,7 @@ export class PlayerShellComponent implements OnInit, OnDestroy {
return;
}
const phase = this.session.session.status || 'lobby';
const phase = this.gameplayPhase ?? this.session.session.status ?? 'lobby';
const code = this.normalizeCode(this.session.session.code || this.sessionCode);
if (!code) {
return;