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,
|
||||
)
|
||||
await transaction.wait()
|
||||
subscription = await getSubscriptionInfo(
|
||||
instance.blockchain_contract_address,
|
||||
signer,
|
||||
profileEthereumAddress,
|
||||
)
|
||||
subscriptionState = await getSubscriptionState(
|
||||
instance.blockchain_contract_address,
|
||||
signer,
|
||||
|
@ -250,7 +245,11 @@ async function onMakeSubscriptionPayment() {
|
|||
}
|
||||
|
||||
function canCancel(): boolean {
|
||||
return !isCurrentUser() && subscription?.senderBalance && !subscription.senderBalance.isZero()
|
||||
return (
|
||||
!isCurrentUser() &&
|
||||
subscriptionState?.senderBalance &&
|
||||
!subscriptionState.senderBalance.isZero()
|
||||
)
|
||||
}
|
||||
|
||||
async function onCancelSubscription() {
|
||||
|
@ -268,9 +267,10 @@ async function onCancelSubscription() {
|
|||
profileEthereumAddress,
|
||||
)
|
||||
await transaction.wait()
|
||||
subscription = await getSubscriptionInfo(
|
||||
subscriptionState = await getSubscriptionState(
|
||||
instance.blockchain_contract_address,
|
||||
signer,
|
||||
await signer.getAddress(),
|
||||
profileEthereumAddress,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue