Make sender_address field of Subscription object nullable

This commit is contained in:
silverpill 2022-08-31 11:53:23 +00:00
parent 04ff50605f
commit 29b2426f92
2 changed files with 5 additions and 3 deletions

View file

@ -231,7 +231,7 @@ export async function cancelSubscription(
export interface Subscription {
id: number,
sender: Profile,
sender_address: string,
sender_address: string | null,
expires_at: string,
}

View file

@ -250,8 +250,10 @@ function isSubscriptionActive(subscription: Subscription): boolean {
}
function onSubscriberSelected(subscription: Subscription) {
subscriberAddress = subscription.sender_address
subscriptionState = null
if (subscription.sender_address !== null) {
subscriberAddress = subscription.sender_address
subscriptionState = null
}
}
async function onCheckSubsciptionState() {