diff --git a/src/common/handleShare.js b/src/common/handleShare.js index ca9488b..f69d98e 100644 --- a/src/common/handleShare.js +++ b/src/common/handleShare.js @@ -1,6 +1,6 @@ import sendAnalytics from "./sendAnalytics"; -export function assembleShareLink({url, seed, query="id"}) { +export function assembleShareLink({url, seed, query = "id"}) { const fullUrl = seed ? `${url}?${query}=${seed}` : url; return fullUrl; } diff --git a/src/common/hasVisitedSince.js b/src/common/hasVisitedSince.js index 394becd..113849e 100644 --- a/src/common/hasVisitedSince.js +++ b/src/common/hasVisitedSince.js @@ -1,9 +1,7 @@ import {convertYYYYMMDDToDate} from "./convertYYYYMMDDToDate"; export function hasVisitedSince(savedStateName, resetDateString) { - let lastVisitedYYYYMMDD = JSON.parse( - localStorage.getItem(savedStateName), - ); + let lastVisitedYYYYMMDD = JSON.parse(localStorage.getItem(savedStateName)); if (!lastVisitedYYYYMMDD) { return false; diff --git a/src/components/App.js b/src/components/App.js index d372e00..bd21103 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -33,9 +33,7 @@ export default function App() { }, [lastVisited]); // Determine what view to show the user - const savedDisplay = JSON.parse( - localStorage.getItem("blobbleDisplay"), - ); + const savedDisplay = JSON.parse(localStorage.getItem("blobbleDisplay")); const [display, setDisplay] = React.useState( getInitialState(savedDisplay, hasVisited), ); @@ -107,10 +105,7 @@ export default function App() { }, []); React.useEffect(() => { - window.localStorage.setItem( - "blobbleDisplay", - JSON.stringify(display), - ); + window.localStorage.setItem("blobbleDisplay", JSON.stringify(display)); }, [display]); React.useEffect(() => { diff --git a/src/logic/getConnectivity.js b/src/logic/getConnectivity.js index 1d39dbf..cc329b1 100644 --- a/src/logic/getConnectivity.js +++ b/src/logic/getConnectivity.js @@ -7,7 +7,7 @@ export function getConnectivity(indexes, gridSize) { if (gridSize <= 0) { throw new Error("Grid size must be greater than 0"); } - + // error if index exceeds the grid size if (indexes.some((index) => index >= gridSize * gridSize || index < 0)) { throw new Error("Index is not within grid size"); @@ -20,7 +20,9 @@ export function getConnectivity(indexes, gridSize) { numColumns: gridSize, numRows: gridSize, }); - const surroundingIndexesInInput = surroundingIndexesInGrid.filter((neighbor) => neighbor != index && indexes.includes(neighbor)); + const surroundingIndexesInInput = surroundingIndexesInGrid.filter( + (neighbor) => neighbor != index && indexes.includes(neighbor), + ); connectivity += surroundingIndexesInInput.length; });