Disable subscription payment form when sender is same as recipient

This commit is contained in:
silverpill 2022-09-08 18:54:46 +00:00
parent 2ebd2bad62
commit 65cc9c706f
2 changed files with 10 additions and 2 deletions

View file

@ -234,7 +234,10 @@ async function checkSubscription() {
}
function canSubscribe(): boolean {
return subscriptionsEnabled === true
return (
sender.id !== recipient.id &&
subscriptionsEnabled === true
)
}
function getPaymentAmount(): FixedNumber {

View file

@ -168,7 +168,12 @@ function isSubscribed(): boolean {
}
function canSubscribe(): boolean {
return sender.id !== "" && subscriptionPrice !== null && invoice === null
return (
sender.id !== "" &&
sender.id !== recipient.id &&
subscriptionPrice !== null &&
invoice === null
)
}
function getPaymentAmount(): number {