Skip to content

Commit

Permalink
auth bug solved (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
manangouhari authored Mar 3, 2021
1 parent 9125b2d commit 8187d15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/pages/tezos/marketplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Footer from 'src/components/Footer';
import CryptobotCard from 'src/components/CryptobotCard';
import uniqBy from 'lodash.uniqby';
import Loader from 'react-loader-spinner';

import userAtom from 'src/atoms/user-atom';
import isUserAtom from 'src/atoms/is-user-atom';
import { useAtom } from 'jotai';

Expand All @@ -22,6 +22,7 @@ const Marketplace = () => {
const [sortBy, updateSortBy] = useState('offerDate');
const [nftList, updateNftList] = useState([]);
const [xtzPrice, updateXtzPrice] = useState(null);
const [user] = useAtom(userAtom);
const [isUser] = useAtom(isUserAtom);

const allNFTS = useAsync(async () => {
Expand Down Expand Up @@ -91,8 +92,8 @@ const Marketplace = () => {
}, []);

useEffect(() => {
// console.log(user, isUser);
if (!isUser) {
console.log(user, isUser);
if (!isUser || !user?.verified) {
const url =
typeof window !== 'undefined' ? window.location.pathname : '/tezos';
navigate('/auth', { state: { pathname: url } });
Expand Down
8 changes: 4 additions & 4 deletions src/pages/tezos/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ const Empty = () => {
<div className="grid md:grid-cols-2 grid-cols-1 space-x-4 mx-auto justify-center mt-4">
<Link to="/tezos/marketplace">
<Button size="lg" type="secondary">
Browse Marketplace
Browse Marketplace
</Button>
</Link>
<Link to="/tezos/academy">
<Button size="lg" type="primary">
Go to Academy
Go to Academy
</Button>
</Link>
</div>
Expand All @@ -52,8 +52,8 @@ function Profile() {
const [isUser] = useAtom(isUserAtom);

useEffect(() => {
// console.log(user, isUser);
if (!isUser) {
console.log(user, isUser);
if (!isUser || !user?.verified) {
const url =
typeof window !== 'undefined' ? window.location.pathname : '/tezos';
navigate('/auth', { state: { pathname: url } });
Expand Down

0 comments on commit 8187d15

Please sign in to comment.