]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Alphabetical order for channels filter
authorChocobozzz <me@florianbigard.com>
Mon, 19 Jun 2023 09:12:02 +0000 (11:12 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 19 Jun 2023 09:18:56 +0000 (11:18 +0200)
client/src/app/+my-library/my-videos/my-videos.component.ts
client/src/app/core/server/server.service.ts

index b618b3f8823c3e1d79b82507459a38eec80d639b..57b8bdf7de26518bb0671d08456dfff7e513ada6 100644 (file)
@@ -105,12 +105,14 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
       this.user = this.authService.getUser()
       this.userChannels = this.user.videoChannels
 
-      const channelFilters = this.userChannels.map(c => {
-        return {
-          value: 'channel:' + c.name,
-          label: c.displayName
-        }
-      })
+      const channelFilters = [ ...this.userChannels ]
+        .sort((a, b) => a.displayName.localeCompare(b.displayName))
+        .map(c => {
+          return {
+            value: 'channel:' + c.name,
+            label: c.displayName
+          }
+        })
 
       this.inputFilters = [
         {
index 75dbe3e60581e4a2698a274414df320f7bd9df89..122c3d37d7bb0177fd06db60779ab68bbb8d65c9 100644 (file)
@@ -2,7 +2,7 @@ import { Observable, of, Subject } from 'rxjs'
 import { first, map, share, shareReplay, switchMap, tap } from 'rxjs/operators'
 import { HttpClient } from '@angular/common/http'
 import { Inject, Injectable, LOCALE_ID } from '@angular/core'
-import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers'
+import { getDevLocale, isOnDevLocale } from '@app/helpers'
 import { logger } from '@root-helpers/logger'
 import { getCompleteLocale, isDefaultLocale, peertubeTranslate } from '@shared/core-utils/i18n'
 import { HTMLServerConfig, ServerConfig, ServerStats, VideoConstant } from '@shared/models'