Make rematch disabled conditions clearer

pull/9947/head
Benedikt Werner 2021-10-08 16:24:05 +02:00
parent a6a8b320f1
commit fc7db325eb
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
1 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ function analysisButton(ctrl: RoundController): VNode | null {
function rematchButtons(ctrl: RoundController): MaybeVNodes {
const d = ctrl.data,
me = !!d.player.offeringRematch,
disabled = !me && !(d.opponent.onGame || (!d.clock && d.player.user && d.opponent.user)),
disabled = !me && !d.opponent.onGame && (d.clock || !d.player.user || !d.opponent.user),
them = !!d.opponent.offeringRematch && !disabled,
noarg = ctrl.noarg;
return [
@ -338,7 +338,7 @@ export function followUp(ctrl: RoundController): VNode {
const d = ctrl.data,
rematchable =
!d.game.rematch &&
(status.finished(d) || (status.aborted(d) && !(d.game.rated && ['lobby', 'pool'].includes(d.game.source)))) &&
(status.finished(d) || (status.aborted(d) && (!d.game.rated || !['lobby', 'pool'].includes(d.game.source)))) &&
!d.tournament &&
!d.simul &&
!d.swiss &&