Skip to content

Commit

Permalink
Move the goToPly function definition closer.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Dec 12, 2024
1 parent bc2dac4 commit 5a2b55d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/round/src/view/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ const renderMove = (step: Step, curPly: number, orEmpty: boolean, drawOffers: Se
])
: orEmpty && h(moveTag, '…');

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

export function renderResult(ctrl: RoundController): VNode | undefined {
let result: string | undefined;
if (finished(ctrl.data))
Expand Down Expand Up @@ -135,6 +130,11 @@ export function analysisButton(ctrl: RoundController): LooseVNode {
);
}

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

const goThroughMoves = (ctrl: RoundController, e: Event) => {
let timeoutId: number | undefined = undefined;
const clearMovesTimeout = () => {
Expand Down

0 comments on commit 5a2b55d

Please sign in to comment.