]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/server/server.service.ts
Handle overview pagination in client
[github/Chocobozzz/PeerTube.git] / client / src / app / core / server / server.service.ts
index e015d0e1430d9e7f9727dd5c70f595804602e1f9..da7832b3261e8cf5765e66f3d81994f24697e723 100644 (file)
@@ -263,17 +263,19 @@ export class ServerService {
                               .pipe(map(data => ({ data, translations })))
                  }),
                  map(({ data, translations }) => {
-                   const hashToPopulate: VideoConstant<T>[] = []
-
-                   Object.keys(data)
-                         .forEach(dataKey => {
-                           const label = data[ dataKey ]
-
-                           hashToPopulate.push({
-                             id: (attributeName === 'languages' ? dataKey : parseInt(dataKey, 10)) as T,
-                             label: peertubeTranslate(label, translations)
-                           })
-                         })
+                   const hashToPopulate: VideoConstant<T>[] = Object.keys(data)
+                                                                    .map(dataKey => {
+                                                                      const label = data[ dataKey ]
+
+                                                                      const id = attributeName === 'languages'
+                                                                        ? dataKey as T
+                                                                        : parseInt(dataKey, 10) as T
+
+                                                                      return {
+                                                                        id,
+                                                                        label: peertubeTranslate(label, translations)
+                                                                      }
+                                                                    })
 
                    if (sort === true) sortBy(hashToPopulate, 'label')