fix: sub renew

This commit is contained in:
Kieran 2023-10-22 14:10:11 +01:00
parent 454f957653
commit 46d7c000ac
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -21,7 +21,7 @@ export function RenewSub({ sub: s }: { sub?: Subscription }) {
const recentSub = mostRecentSubscription(subscriptions);
const sub =
s ?? recentSub
s ?? (recentSub
? ({
id: unwrap(recentSub).id,
type: unwrap(recentSub).type,
@ -29,7 +29,7 @@ export function RenewSub({ sub: s }: { sub?: Subscription }) {
expires: unwrap(recentSub).end,
state: unwrap(recentSub).end > unixNow() ? "expired" : "paid",
} as Subscription)
: undefined;
: undefined);
async function renew(id: string, months: number) {
const api = new SnortApi(undefined, publisher);