Skip to content

Commit

Permalink
Check if a ply is not NaN before jumping to it.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Dec 10, 2024
1 parent 5acaee6 commit 9573fca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/round/src/view/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const renderMove = (step: Step, curPly: number, orEmpty: boolean, drawOffers: Se
: orEmpty && h(moveTag, '…');

const goToPly = (ctrl: RoundController, ply: number) => {
ctrl.userJump(ply);
if (!isNaN(ply)) ctrl.userJump(ply);
ctrl.redraw();
};

Expand Down Expand Up @@ -204,6 +204,7 @@ function initMessage(ctrl: RoundController) {
}

const col1Button = (ctrl: RoundController, dir: number, icon: string, disabled: boolean) =>
// todo: update the stuff for mobile (in vertical mode) here:
h('button.fbt', {
attrs: { disabled: disabled, 'data-icon': icon, 'data-ply': ctrl.ply + dir },
hook: bind('mousedown', e => {
Expand Down

0 comments on commit 9573fca

Please sign in to comment.