From 4c9162076c642483c4c38389e368faae4ebe4aac Mon Sep 17 00:00:00 2001 From: johndoknjas Date: Tue, 10 Dec 2024 22:40:45 -0800 Subject: [PATCH] Format with prettier. --- ui/round/src/view/replay.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/round/src/view/replay.ts b/ui/round/src/view/replay.ts index 441511c928d7a..8f06d53734f80 100644 --- a/ui/round/src/view/replay.ts +++ b/ui/round/src/view/replay.ts @@ -136,7 +136,7 @@ export function analysisButton(ctrl: RoundController): LooseVNode { } const goThroughMoves = (ctrl: RoundController) => { - return function(e: MouseEvent) { + return function (e: MouseEvent) { e.preventDefault(); let timeoutId: number | undefined = undefined; const clearMovesTimeout = () => { @@ -144,18 +144,21 @@ const goThroughMoves = (ctrl: RoundController) => { }; const targetPly = (e: MouseEvent) => parseInt((e.target as HTMLElement).getAttribute('data-ply') || ''); const delay = showMovesDecreasingDelay(); - document.addEventListener(e.type === 'touchstart' ? 'touchend' : 'mouseup', () => clearMovesTimeout(), { once: true }); + document.addEventListener(e.type === 'touchstart' ? 'touchend' : 'mouseup', () => clearMovesTimeout(), { + once: true, + }); const repeat = () => { goToPly(ctrl, targetPly(e)); timeoutId = setTimeout(repeat, delay.next().value!); if (isNaN(targetPly(e))) clearMovesTimeout(); }; repeat(); - } -} + }; +}; function renderButtons(ctrl: RoundController) { - const firstPly = util.firstPly(ctrl.data), lastPly = util.lastPly(ctrl.data); + const firstPly = util.firstPly(ctrl.data), + lastPly = util.lastPly(ctrl.data); return h( 'div.buttons', {