Fix cancel button on subscription page
This commit is contained in:
parent
12a06d711d
commit
4aa085fd86
1 changed files with 7 additions and 7 deletions
|
@ -236,11 +236,6 @@ async function onMakeSubscriptionPayment() {
|
||||||
profileEthereumAddress,
|
profileEthereumAddress,
|
||||||
)
|
)
|
||||||
await transaction.wait()
|
await transaction.wait()
|
||||||
subscription = await getSubscriptionInfo(
|
|
||||||
instance.blockchain_contract_address,
|
|
||||||
signer,
|
|
||||||
profileEthereumAddress,
|
|
||||||
)
|
|
||||||
subscriptionState = await getSubscriptionState(
|
subscriptionState = await getSubscriptionState(
|
||||||
instance.blockchain_contract_address,
|
instance.blockchain_contract_address,
|
||||||
signer,
|
signer,
|
||||||
|
@ -250,7 +245,11 @@ async function onMakeSubscriptionPayment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function canCancel(): boolean {
|
function canCancel(): boolean {
|
||||||
return !isCurrentUser() && subscription?.senderBalance && !subscription.senderBalance.isZero()
|
return (
|
||||||
|
!isCurrentUser() &&
|
||||||
|
subscriptionState?.senderBalance &&
|
||||||
|
!subscriptionState.senderBalance.isZero()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onCancelSubscription() {
|
async function onCancelSubscription() {
|
||||||
|
@ -268,9 +267,10 @@ async function onCancelSubscription() {
|
||||||
profileEthereumAddress,
|
profileEthereumAddress,
|
||||||
)
|
)
|
||||||
await transaction.wait()
|
await transaction.wait()
|
||||||
subscription = await getSubscriptionInfo(
|
subscriptionState = await getSubscriptionState(
|
||||||
instance.blockchain_contract_address,
|
instance.blockchain_contract_address,
|
||||||
signer,
|
signer,
|
||||||
|
await signer.getAddress(),
|
||||||
profileEthereumAddress,
|
profileEthereumAddress,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue