Skip to content

Commit

Permalink
[fix] 🐛 disable notifications in web-context (#375, #376)
Browse files Browse the repository at this point in the history
  • Loading branch information
dappsar committed Jul 20, 2024
1 parent f6a6dc0 commit 0fd430b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/context/NotificationContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ export function NotificationProvider({ children }) {
})
}

const getNotificationsByUser = (userWalletAddress) => {
/*
if (!userWalletAddress) return notifications
const getNotificationsByUser = (user) => {
if (!user || !notifications.length) return notifications
const myNotifications = notifications.filter(
(notification) => notification.walletAddress === userWalletAddress && notification.deleted === false
(notification) => notification.walletAddress === user && notification.deleted === false
)
return filterUniqueNotifications(myNotifications)
*/
}

/*
useEffect(() => {
const filteredNotifications = getNotificationsByUser(walletAddress)
setNotifications(filteredNotifications)
}, [walletAddress]) // eslint-disable-line react-hooks/exhaustive-deps
}, [walletAddress]) //eslint-disable-line react-hooks/exhaustive-deps
*/

const addNotification = (user, message, data) => {
Expand Down
8 changes: 5 additions & 3 deletions src/context/Web3Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import gammaCardsAbi from './abis/gamma/GammaCards.v5.sol/NofGammaCardsV5.json'
import gammaOffersAbi from './abis/gamma/GammaOffers.v4.sol/NofGammaOffersV4.json'
import gammaTicketsAbi from './abis/gamma/GammaTickets.v1.sol/NofGammaTicketsV1.json'
import { NETWORKS, walletConnectProjectId, environment } from '../config'
import { NotificationContext } from './NotificationContext'
import { getAccountAddressText } from '../utils/stringUtils'
// import { NotificationContext } from './NotificationContext'
// import { getAccountAddressText } from '../utils/stringUtils'

const initialState = {
connectWallet: () => {},
Expand All @@ -37,7 +37,7 @@ function Web3ContextProvider({ children }) {
const [gammaCardsContract, setGammaCardsContract] = useState(null)
const [gammaOffersContract, setGammaOffersContract] = useState(null)
const [gammaTicketsContract, setGammaTicketsContract] = useState(null)
const { addNotification } = useContext(NotificationContext)
// const { addNotification } = useContext(NotificationContext)
const { address, chainId, isConnected } = useWeb3ModalAccount()
const { walletProvider } = useWeb3ModalProvider()
const { disconnect } = useDisconnect()
Expand Down Expand Up @@ -138,6 +138,7 @@ function Web3ContextProvider({ children }) {
_signer
)

/*
gammaPacksContractInstance.on('PackTransfered', (from, to, tokenId) => {
const packNbr = ethers.BigNumber.from(tokenId).toNumber()
addNotification(to, 'notification_pack_transfer', [
Expand Down Expand Up @@ -188,6 +189,7 @@ function Web3ContextProvider({ children }) {
{ item: 'TICKET_ID', value: ticketId, valueShort: getAccountAddressText(ticketId) }
])
})
*/

setDaiContract(daiContractInstance)
setAlphaContract(alphaContractInstance)
Expand Down

0 comments on commit 0fd430b

Please sign in to comment.