Skip to content

Commit

Permalink
Merge pull request #248 from P4-Games/fix/match-endpoint
Browse files Browse the repository at this point in the history
[fix] 🩹 fix comparisson in match
  • Loading branch information
dappsar authored Dec 13, 2023
2 parents 9820bd1 + 2dfe554 commit 96bae1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Binary file added public/images/notifications/message2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Navbar() {

const ButtonNotification = () => (
<div onClick={() => handleNotificationClick()} className='navbar__right__coin'>
<Image src={'/images/notifications/message.png'} alt='coin' height='60' width='60' />
<Image src={'/images/notifications/message2.png'} alt='coin' height='60' width='60' />
{notificationsNbr > 0 && <div className={notificationsNbrClass}>{notificationsNbr}</div>}
</div>
)
Expand Down
10 changes: 5 additions & 5 deletions src/pages/api/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export default async function handler(req, res) {
const u1NotInU2 = getNotPresentCards(u1Cards, u2Cards)
const u2NotInU1 = getNotPresentCards(u2Cards, u1Cards)

console.log(u1Cards, u2Cards, u1NotInU2, u2NotInU1)
const match = Object.keys(u1NotInU2).length > 0 || Object.keys(u2NotInU1).length > 0;

res.setHeader('Content-Type', 'application/json')
res.status(200).json({
user1: u1Cards,
user2: u2Cards,
match: u1Cards.length > 0 && u2Cards.length > 0
user1: u1NotInU2,
user2: u2NotInU1,
match: match
})
} catch (error) {
console.error(error)
Expand All @@ -51,7 +51,7 @@ async function getFilteredCards(contractInstance, wallet) {

const filteredCards = Object.keys(userCards).reduce((filtered, key) => {
const card = userCards[key]
if (card.quantity > 1 && card.stamped === true) {
if (card.quantity > 1) {
filtered[key] = card
}
return filtered
Expand Down

0 comments on commit 96bae1c

Please sign in to comment.