Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug display free post #241

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/firebase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hosting": {
"site": "sofan-app",
"site": "staging-sofan-app",
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
Expand Down
21 changes: 10 additions & 11 deletions client/src/Pages/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ function Home({
// console.log(loggedInUser);
if (
dataPost &&
loggedInUser &&
(loggedInUser?.metamask || loggedInUser?.web3auth)
loggedInUser
// && (loggedInUser?.metamask || loggedInUser?.web3auth)
) {
// 1 for loop de data post
// Await nft collections where id === element.athlete id
Expand Down Expand Up @@ -205,11 +205,10 @@ function Home({
}

let currentUserWallet;

if (loggedInUser.metamask) {
currentUserWallet = loggedInUser.metamask;
} else if (loggedInUser.web3auth) {
currentUserWallet = loggedInUser.web3auth;
if (loggedInUser?.metamask) {
currentUserWallet = loggedInUser?.metamask;
} else if (loggedInUser?.web3auth) {
currentUserWallet = loggedInUser?.web3auth;
}

const web3Instance = new Web3(
Expand Down Expand Up @@ -241,13 +240,13 @@ function Home({

let judgement;
if (isUserFan === false && dataPost[i]?.visibility === false) {
// console.log("pas fan et post privé");
console.log("pas fan et post privé");
judgement = true;
} else if (isUserFan === true && dataPost[i]?.visibility === false) {
// console.log("Fan et post privé");
console.log("Fan et post privé");
judgement = false;
} else if (dataPost[i]?.visibility === true) {
// console.log("post public");
console.log("post public");
judgement = false;
}

Expand All @@ -256,7 +255,7 @@ function Home({
// console.log(tempIsUserFanArray);
setIsUserFanArray(tempIsUserFanArray);
};

console.log("appel de la fontion feedDataFrom")
feedDataFromAlchemyAndFirebase();

// if (loggedInUser.metamask) {
Expand Down
Loading