fix(frontend): prefer canonical phase for client action gating
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user