From 29b2426f928d3abde720a1ee6590b6b64be6166b Mon Sep 17 00:00:00 2001 From: silverpill Date: Wed, 31 Aug 2022 11:53:23 +0000 Subject: [PATCH] Make sender_address field of Subscription object nullable --- src/api/subscriptions.ts | 2 +- src/components/SubscriptionSetup.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/subscriptions.ts b/src/api/subscriptions.ts index ff14dbc..3904ca8 100644 --- a/src/api/subscriptions.ts +++ b/src/api/subscriptions.ts @@ -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, } diff --git a/src/components/SubscriptionSetup.vue b/src/components/SubscriptionSetup.vue index 9b65a80..d9d750f 100644 --- a/src/components/SubscriptionSetup.vue +++ b/src/components/SubscriptionSetup.vue @@ -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() {