aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-25 15:11:25 +0200
committerChocobozzz <me@florianbigard.com>2018-07-25 15:11:25 +0200
commitad77475251c3516dd5851a08655be79d7bf76245 (patch)
tree3b816fa225a8b9f50bbdc6edd8bdc2d2dfbe5ce2 /client/src/app/core/server
parentf842e810b450a34275d8d453d5d9431a4e1b882a (diff)
downloadPeerTube-ad77475251c3516dd5851a08655be79d7bf76245.tar.gz
PeerTube-ad77475251c3516dd5851a08655be79d7bf76245.tar.zst
PeerTube-ad77475251c3516dd5851a08655be79d7bf76245.zip
Sort video captions
Diffstat (limited to 'client/src/app/core/server')
-rw-r--r--client/src/app/core/server/server.service.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index 87280e16f..7b11c068e 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -2,13 +2,14 @@ import { map, share, switchMap, tap } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
3import { Inject, Injectable, LOCALE_ID } from '@angular/core' 3import { Inject, Injectable, LOCALE_ID } from '@angular/core'
4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' 4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
5import { Observable, ReplaySubject, of } from 'rxjs' 5import { Observable, of, ReplaySubject } from 'rxjs'
6import { getCompleteLocale, ServerConfig } from '../../../../../shared' 6import { getCompleteLocale, ServerConfig } from '../../../../../shared'
7import { About } from '../../../../../shared/models/server/about.model' 7import { About } from '../../../../../shared/models/server/about.model'
8import { environment } from '../../../environments/environment' 8import { environment } from '../../../environments/environment'
9import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos' 9import { VideoConstant } from '../../../../../shared/models/videos'
10import { isDefaultLocale } from '../../../../../shared/models/i18n' 10import { isDefaultLocale } from '../../../../../shared/models/i18n'
11import { getDevLocale, isOnDevLocale, peertubeTranslate } from '@app/shared/i18n/i18n-utils' 11import { getDevLocale, isOnDevLocale, peertubeTranslate } from '@app/shared/i18n/i18n-utils'
12import { sortBy } from '@app/shared/misc/utils'
12 13
13@Injectable() 14@Injectable()
14export class ServerService { 15export class ServerService {
@@ -156,13 +157,7 @@ export class ServerService {
156 }) 157 })
157 }) 158 })
158 159
159 if (sort === true) { 160 if (sort === true) sortBy(hashToPopulate, 'label')
160 hashToPopulate.sort((a, b) => {
161 if (a.label < b.label) return -1
162 if (a.label === b.label) return 0
163 return 1
164 })
165 }
166 161
167 notifier.next(true) 162 notifier.next(true)
168 }) 163 })