aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/helpers')
-rw-r--r--client/src/app/helpers/utils.ts18
1 files changed, 12 insertions, 6 deletions
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts
index a1747af3c..17eb5effc 100644
--- a/client/src/app/helpers/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -30,12 +30,18 @@ function listUserChannels (authService: AuthService) {
30 const videoChannels = user.videoChannels 30 const videoChannels = user.videoChannels
31 if (Array.isArray(videoChannels) === false) return undefined 31 if (Array.isArray(videoChannels) === false) return undefined
32 32
33 return videoChannels.map(c => ({ 33 return videoChannels
34 id: c.id, 34 .sort((a, b) => {
35 label: c.displayName, 35 if (a.updatedAt < b.updatedAt) return 1
36 support: c.support, 36 if (a.updatedAt > b.updatedAt) return -1
37 avatarPath: c.avatar?.path 37 return 0
38 }) as SelectChannelItem) 38 })
39 .map(c => ({
40 id: c.id,
41 label: c.displayName,
42 support: c.support,
43 avatarPath: c.avatar?.path
44 }) as SelectChannelItem)
39 })) 45 }))
40} 46}
41 47