aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-03-11 16:41:38 +0100
committerChocobozzz <me@florianbigard.com>2020-03-11 16:45:09 +0100
commit111fdc267b36201cf1be1fdf91017005102b4a5e (patch)
tree5ea98f766cc74de3434a855e998e763324e9da72 /client/src/app/core/server
parent764a965778ac89e027fd05dd35697c6763e0dc18 (diff)
downloadPeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.tar.gz
PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.tar.zst
PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.zip
Handle overview pagination in client
Diffstat (limited to 'client/src/app/core/server')
-rw-r--r--client/src/app/core/server/server.service.ts24
1 files changed, 13 insertions, 11 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index e015d0e14..da7832b32 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -263,17 +263,19 @@ export class ServerService {
263 .pipe(map(data => ({ data, translations }))) 263 .pipe(map(data => ({ data, translations })))
264 }), 264 }),
265 map(({ data, translations }) => { 265 map(({ data, translations }) => {
266 const hashToPopulate: VideoConstant<T>[] = [] 266 const hashToPopulate: VideoConstant<T>[] = Object.keys(data)
267 267 .map(dataKey => {
268 Object.keys(data) 268 const label = data[ dataKey ]
269 .forEach(dataKey => { 269
270 const label = data[ dataKey ] 270 const id = attributeName === 'languages'
271 271 ? dataKey as T
272 hashToPopulate.push({ 272 : parseInt(dataKey, 10) as T
273 id: (attributeName === 'languages' ? dataKey : parseInt(dataKey, 10)) as T, 273
274 label: peertubeTranslate(label, translations) 274 return {
275 }) 275 id,
276 }) 276 label: peertubeTranslate(label, translations)
277 }
278 })
277 279
278 if (sort === true) sortBy(hashToPopulate, 'label') 280 if (sort === true) sortBy(hashToPopulate, 'label')
279 281