From 633886df983c43a98a9b30b53849d65c8117b8be Mon Sep 17 00:00:00 2001 From: thisisommore Date: Sun, 3 Sep 2023 17:46:42 +0000 Subject: [PATCH] Fix wrong monetizeid in unlist --- src/app/account/AccountListBtn.tsx | 4 ++-- src/app/account/page.tsx | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/account/AccountListBtn.tsx b/src/app/account/AccountListBtn.tsx index c946fac..08ac788 100644 --- a/src/app/account/AccountListBtn.tsx +++ b/src/app/account/AccountListBtn.tsx @@ -9,7 +9,7 @@ const AccountListBtn = ({ // monetizeId should be -1 when it is non existence monetizeId: bigint; onList: () => void; - onUnlist: () => void; + onUnlist: (monetizeId: bigint) => void; }) => { return ( { - (monetizeId ?? -1) > -1 ? onUnlist() : onList(); + (monetizeId ?? -1) > -1 ? onUnlist(monetizeId) : onList(); }} > {(monetizeId ?? -1) > -1 ? "Unlist" : "List"} diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index 2a8605f..8a099bd 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -1,6 +1,5 @@ "use client"; import MintSongButton from "@/components/MintSongButton/MintSongButton"; -import OButton from "@/components/OButton/OButton"; import SongListItemMusicNFT from "@/components/SongList/SongListItemMusicNFT"; import SongListItemSpinamp from "@/components/SongList/SongListItemSpinamp"; import { AppWalletContext } from "@/context/AppWallet"; @@ -168,7 +167,7 @@ const Account = () => { walletClient ); }} - onUnlist={() => { + onUnlist={(monetizeId) => { if ( !walletClient || !publicClient || @@ -177,7 +176,7 @@ const Account = () => { !e.tokenUri ) return; - unmonetize(BigInt(e.tokenId), publicClient, walletClient); + unmonetize(monetizeId, publicClient, walletClient); }} /> } @@ -218,9 +217,9 @@ const Account = () => { walletClient ); }} - onUnlist={() => { + onUnlist={(monetizeId) => { if (!walletClient || !publicClient || !e.id) return; - unmonetize(BigInt(e.id), publicClient, walletClient); + unmonetize(monetizeId, publicClient, walletClient); }} /> }