From 06da58ac52d5f60d74002749a38ec64d3b0cbb1b Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 12 May 2023 17:37:27 +0100 Subject: [PATCH] bug: sort active subscriptions by type --- packages/app/src/Subscription/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/Subscription/index.ts b/packages/app/src/Subscription/index.ts index 6841c8ed2..e1faf8aa6 100644 --- a/packages/app/src/Subscription/index.ts +++ b/packages/app/src/Subscription/index.ts @@ -52,7 +52,7 @@ export interface SubscriptionEvent { export function getActiveSubscriptions(s: Array) { const now = unixNow(); - return s.filter(a => a.start <= now && a.end > now); + return [...s].sort((a, b) => b.type - a.type).filter(a => a.start <= now && a.end > now); } export function getCurrentSubscription(s: Array) {