bug: sort active subscriptions by type

This commit is contained in:
Kieran 2023-05-12 17:37:27 +01:00
parent 41a2f06f58
commit 06da58ac52
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ export interface SubscriptionEvent {
export function getActiveSubscriptions(s: Array<SubscriptionEvent>) {
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<SubscriptionEvent>) {