Merge pull request #5160 from monoidal/fix-abort-title

Fix document.title when a game is aborted
pull/5147/head
Thibault Duplessis 2019-06-03 18:03:16 +02:00 committed by GitHub
commit e645619f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import { isPlayerTurn } from 'game';
import { finished } from 'game/status';
import { aborted, finished } from 'game/status';
import RoundController from './ctrl';
const initialTitle = document.title;
@ -41,7 +41,7 @@ export function init() {
export function set(ctrl: RoundController, text?: string) {
if (ctrl.data.player.spectator) return;
if (!text) {
if (finished(ctrl.data)) {
if (aborted(ctrl.data) || finished(ctrl.data)) {
text = ctrl.trans('gameOver');
} else if (isPlayerTurn(ctrl.data)) {
text = ctrl.trans('yourTurn');