Skip to content

Commit

Permalink
Merge pull request #12 from reedoooo/dev18
Browse files Browse the repository at this point in the history
  • Loading branch information
reedoooo authored Nov 25, 2023
2 parents 2e31992 + f33335c commit 09e6247
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ import { useCookies } from 'react-cookie';
import { useDeckStore } from './context/DeckContext/DeckContext';
import { useCartStore } from './context/CartContext/CartContext';
const App = () => {
const [cookies] = useCookies(['user']);
// const [cookies] = useCookies(['user']);

const user = cookies?.user;
const userId = user?.id;
// const user = cookies?.user;
// const userId = user?.id;
const [currentPage, setCurrentPage] = useState('');
// const { setContext } = useAppContext(); // Assuming useAppContext provides setContext
const { fetchAllCollectionsForUser, selectedCollection } =
useCollectionStore();
const { user, fetchUser } = useUserContext();
const userId = user?.id;
console.log('user', user);
console.log('userId', userId);
const { allDecks, fetchAllDecksForUser, selectedDeck } = useDeckStore();
const { fetchUserCart, cartData } = useCartStore();
const { isLoading, setIsLoading } = useUtilityContext();
Expand All @@ -48,7 +52,7 @@ const App = () => {
// }, []); // Add this useEffect

useEffect(() => {
if (user) {
if (userId) {
fetchAllCollectionsForUser()
.then(() => {
setIsLoading(false);
Expand Down

0 comments on commit 09e6247

Please sign in to comment.