Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
skedwards88 committed Jul 21, 2024
1 parent f8da270 commit 14d572e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/common/handleShare.js
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
4 changes: 1 addition & 3 deletions src/common/hasVisitedSince.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
9 changes: 2 additions & 7 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
Expand Down Expand Up @@ -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(() => {
Expand Down
6 changes: 4 additions & 2 deletions src/logic/getConnectivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
});

Expand Down

0 comments on commit 14d572e

Please sign in to comment.