From e24dbb03520be869b2b7503b921f5dbc8f46d1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B8ssum?= <1959615+joglr@users.noreply.github.com> Date: Wed, 23 Nov 2022 23:34:52 +0100 Subject: [PATCH] Add missing linebreaks --- src/App.tsx | 10 +++++----- src/constants.ts | 2 +- src/util.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f5be3a4..da4c308 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -85,7 +85,7 @@ export default function App() { const state_ = JSON.stringify(state, (k, v) => k === "userPieces" ? null : v) const getInitialState_ = JSON.stringify(getInitialState(), (k, v) => k === "userPieces" ? null : v) - + if( JSON.stringify(prevState.userPieces) !== JSON.stringify(state.userPieces) && state_ !== getInitialState_ @@ -117,7 +117,7 @@ export default function App() { setState(prevState => { const userPieces = prevState.userPieces.map((piece, i) => i === selectedPieceIndex ? null : piece) // only enable if user has any undos left - + return ({ board: newBoard, userPieces: userPieces.every(p => p == null) @@ -135,7 +135,7 @@ export default function App() { // if (shouldSucceed !== fit) { // prompt("red test", newTest) // } - + }, [boardWithPreview, fit, queue, state, undoRef, undosLeft]) usePointerExit(pointerUpHandler) @@ -190,7 +190,7 @@ export default function App() { onPointerDown={e => { // Prevent drag behaviour e.preventDefault() - + // Select the piece that was dragged from setState(prevState => ({ ...prevState, @@ -277,4 +277,4 @@ const getNewPieces = (queue: any, undoRef: any) => { undoRef && (undoRef.current.disabled = true) return drawN(pieces, 3) } -} \ No newline at end of file +} diff --git a/src/constants.ts b/src/constants.ts index 56ffc14..7ae99ee 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -19,4 +19,4 @@ export const hues = [ export const highscoreLocalStorageKey = "KLODS_HIGHSCORE" -export const undos = 3 \ No newline at end of file +export const undos = 3 diff --git a/src/util.ts b/src/util.ts index 562243e..8d4f423 100644 --- a/src/util.ts +++ b/src/util.ts @@ -50,7 +50,7 @@ export function checkIfPieceFitsAndUpdateBoard({ ) { return [false, null] } - + const updatedBoard = board.slice() as IBoard for (let i = 0; i < piece.length; i++) {