Skip to content

Commit

Permalink
Fix wrong monetizeid in unlist
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisommore committed Sep 3, 2023
1 parent bd071c1 commit 633886d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/account/AccountListBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ const AccountListBtn = ({
// monetizeId should be -1 when it is non existence
monetizeId: bigint;
onList: () => void;
onUnlist: () => void;
onUnlist: (monetizeId: bigint) => void;
}) => {
return (
<OButton
color={(monetizeId ?? -1) > -1 ? "gray" : "yellow"}
btnType="fill"
className="w-full mt-2"
onClick={() => {
(monetizeId ?? -1) > -1 ? onUnlist() : onList();
(monetizeId ?? -1) > -1 ? onUnlist(monetizeId) : onList();
}}
>
{(monetizeId ?? -1) > -1 ? "Unlist" : "List"}
Expand Down
9 changes: 4 additions & 5 deletions src/app/account/page.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -168,7 +167,7 @@ const Account = () => {
walletClient
);
}}
onUnlist={() => {
onUnlist={(monetizeId) => {
if (
!walletClient ||
!publicClient ||
Expand All @@ -177,7 +176,7 @@ const Account = () => {
!e.tokenUri
)
return;
unmonetize(BigInt(e.tokenId), publicClient, walletClient);
unmonetize(monetizeId, publicClient, walletClient);
}}
/>
}
Expand Down Expand Up @@ -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);
}}
/>
}
Expand Down

0 comments on commit 633886d

Please sign in to comment.