Skip to content

Commit

Permalink
Removed unnescesary context usage
Browse files Browse the repository at this point in the history
  • Loading branch information
BasWilson committed Nov 10, 2021
1 parent db602ea commit 7ad9d35
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import HelpIcon from "../public/icons/help.svg";
import LibraryIcon from "../public/icons/library.svg";
import SlackIcon from "../public/icons/slack.svg";
import { getFullKit, getKitMeasures, getUserDetails, getUserMemberships } from "../services/data-api";
import { measurementCtx } from "../stores/measurements";
import { measurementCtx, measurementsStore } from "../stores/measurements";
import Breaks from "../utils/breakpoints";

const WelcomeMessage = styled.h1`
Expand All @@ -26,13 +26,12 @@ const WelcomeMessage = styled.h1`

function Home({ mainKit }) {
const { user, isLogged } = useAuth();
const measurementsStore = useContext(measurementCtx);

useEffect(() => {
if (mainKit) {
measurementsStore.setSerial(mainKit.serial);
}
}, [mainKit, measurementsStore])
}, [mainKit])

return (
<PageLayout
Expand Down

0 comments on commit 7ad9d35

Please sign in to comment.