Skip to content
Open
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
22 changes: 6 additions & 16 deletions event-dappp/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
// if (primaryWallet && primaryWallet.address) {
// setCurrentAccount(primaryWallet.address);
// setMessage('Wallet connected successfully via Privy!');
// console.log('Connected account via Privy:', primaryWallet.address);
// console.log('Wallet type:', primaryWallet.walletClientType);

// }
// } else if (ready && !authenticated) {
// setCurrentAccount(null);
Expand Down Expand Up @@ -636,8 +635,7 @@ function AppContent() {
if (primaryWallet && primaryWallet.address) {
setCurrentAccount(primaryWallet.address);
setMessage('Wallet connected successfully via Privy!');
console.log('Connected account via Privy:', primaryWallet.address);
console.log('Wallet type:', primaryWallet.walletClientType);

}
} else if (ready && !authenticated) {
setCurrentAccount(null);
Expand Down Expand Up @@ -665,16 +663,12 @@ function AppContent() {
const ethersProvider = new BrowserProvider(provider);
const eventContract = new Contract(CONTRACT_ADDRESS, CONTRACT_ABI, ethersProvider);

console.log('Fetching user info for account:', currentAccount);


// Get user info from contract
const info = await eventContract.userInfo(currentAccount);

console.log('Raw contract response:', {
ticketsBought: info.ticketsBought.toString(),
level: info.level.toString(),
specialOfferCount: info.specialOfferCount.toString()
});


const levels = ['None', 'Bronze', 'Silver', 'Gold', 'Platinum'];
const userLevel = levels[info.level];
Expand All @@ -685,7 +679,7 @@ function AppContent() {
specialOfferCount: info.specialOfferCount.toString(),
};

console.log('Processed user info:', userInfoData);

setUserInfo(userInfoData);

} catch (error) {
Expand Down Expand Up @@ -724,11 +718,7 @@ function AppContent() {
specialOfferCount: info.specialOfferCount.toString(),
});

console.log('User info refreshed:', {
ticketsBought: info.ticketsBought.toString(),
level: userLevel,
specialOfferCount: info.specialOfferCount.toString(),
});


} catch (error) {
console.error("Error refreshing user info:", error);
Expand Down
4 changes: 2 additions & 2 deletions event-dappp/src/components/EventList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
// // Get the current dynamic ticket price from the smart contract
// const currentTicketPrice = await eventContract.ticketPrice(event.eventId);

// console.log(`Dynamic price for event ${event.eventId}:`, formatEther(currentTicketPrice), 'ETH');


// // Send the transaction with the dynamic price
// const tx = await eventContract.buyTicket(event.eventId, {
Expand Down Expand Up @@ -1154,7 +1154,7 @@ const EventList = ({ events, currentAccount, setLoading, setMessage, refetch, fo
// Get the current dynamic ticket price from the smart contract
const currentTicketPrice = await eventContract.ticketPrice(event.eventId);

console.log(`Dynamic price for event ${event.eventId}:`, formatEther(currentTicketPrice), 'ETH');


// Send the transaction with the dynamic price
const tx = await eventContract.buyTicket(event.eventId, {
Expand Down
4 changes: 0 additions & 4 deletions event-dappp/src/components/UserProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,6 @@ const UserProfile = ({ userEvents, userTickets, currentAccount, allEvents, userI
const levelInfo = getLevelInfo(userInfo?.ticketsBought || 0);
const totalTickets = parseInt(userInfo?.ticketsBought || 0);

// Debug information
console.log('UserProfile - userInfo:', userInfo);
console.log('UserProfile - levelInfo:', levelInfo);
console.log('UserProfile - totalTickets:', totalTickets);

return (
<div className="user-profile-container">
Expand Down