From d1206c291bf02144799713ad1ec940a4e6a780c3 Mon Sep 17 00:00:00 2001 From: Kris Liew <39853992+krisliew@users.noreply.github.com> Date: Thu, 14 Oct 2021 17:20:36 +0800 Subject: [PATCH] [Free Pricing] Check minterApproved before cancelMinter() (#836) * Check `minterApproved` before cancelMinter * Feedback change * Update freePrice.ts Co-authored-by: KRIS LIEW Co-authored-by: Matthias Kretschmann --- src/utils/freePrice.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/freePrice.ts b/src/utils/freePrice.ts index 98645e4de..31a6cba8e 100644 --- a/src/utils/freePrice.ts +++ b/src/utils/freePrice.ts @@ -8,6 +8,9 @@ export async function setMinterToPublisher( setError: (msg: string) => void ): Promise { // free pricing v3 workaround part1 + const status = await ocean.OceanDispenser.status(dataTokenAddress) + if (!status?.minterApproved) return + const response = await ocean.OceanDispenser.cancelMinter( dataTokenAddress, accountId