From 25c6c515e0d1012cf05d993300ce84bfa3d2c234 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 16 Jan 2024 14:36:51 +0100 Subject: [PATCH] feat: sort subscriptions --- src/store/subscriptions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/subscriptions.js b/src/store/subscriptions.js index aea5e1d..c539ec5 100644 --- a/src/store/subscriptions.js +++ b/src/store/subscriptions.js @@ -14,7 +14,8 @@ export const subscriptions = { actions: { fetch: async (context) => { const metrics = await axios.get(generateUrl('/apps/gpoddersync/personal_settings/metrics')) - context.commit('set', metrics.data.subscriptions.map(sub => sub.url)) + const subs = [...metrics.data.subscriptions].sort((a, b) => b.listenedSeconds - a.listenedSeconds) + context.commit('set', subs.map(sub => sub.url)) }, }, }