Skip to content

Commit

Permalink
Add missing linebreaks
Browse files Browse the repository at this point in the history
  • Loading branch information
nimrossum committed Nov 23, 2022
1 parent 7923dae commit e24dbb0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -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)
Expand All @@ -135,7 +135,7 @@ export default function App() {
// if (shouldSucceed !== fit) {
// prompt("red test", newTest)
// }

}, [boardWithPreview, fit, queue, state, undoRef, undosLeft])

usePointerExit(pointerUpHandler)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -277,4 +277,4 @@ const getNewPieces = (queue: any, undoRef: any) => {
undoRef && (undoRef.current.disabled = true)
return drawN(pieces, 3)
}
}
}
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export const hues = [

export const highscoreLocalStorageKey = "KLODS_HIGHSCORE"

export const undos = 3
export const undos = 3
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function checkIfPieceFitsAndUpdateBoard({
) {
return [false, null]
}

const updatedBoard = board.slice() as IBoard

for (let i = 0; i < piece.length; i++) {
Expand Down

0 comments on commit e24dbb0

Please sign in to comment.