Skip to content

Commit

Permalink
Fixing console warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cnocon committed Dec 28, 2020
1 parent e43aaca commit 8c0d39d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import NotFound from './components/NotFound/NotFound';
import Deck from './components/Deck/Deck';
import Theme from './Theme';
Expand Down Expand Up @@ -36,7 +36,7 @@ export const App = () => {
</Styled.Content>
</Router>
<Styled.AppFooter>
<p><b>Copyright &copy;2020</b>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="https://cristin.io" target="_blank" rel="noreferrer">CRISTIN.IO</a></p>
<p><b>Copyright &copy;2020</b>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="https://cristin.io" target="_blank" rel="noopener noreferrer">CRISTIN.IO</a></p>
</Styled.AppFooter>
</Styled.MainWrapper>
</Styled.Layout>
Expand Down
13 changes: 7 additions & 6 deletions src/components/Deck/Deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ const Deck = () => {
}
}

useEffect(() => {
if (!CardsContext.cards.length > 0) {
const loadContent = () => {
if (CardsContext.cards.length === 0) {
CardsContext.getCards();
}

if (!CardsContext.categories.length > 0) {
CardsContext.getCategories();
}
}, []);
}

useEffect(() => {
loadContent();
});

return (
<Styled.Deck>
Expand Down

0 comments on commit 8c0d39d

Please sign in to comment.