Przeglądaj źródła

reduce requested file count to 1 in getCollectionLatestFile

Abhinav-grd 4 lat temu
rodzic
commit
bc709d5961
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/services/collectionService.ts

+ 3 - 2
src/services/collectionService.ts

@@ -115,9 +115,10 @@ export const getCollectionLatestFile = async (
     return Promise.all(
     return Promise.all(
         collections.map(async collection => {
         collections.map(async collection => {
             const sinceTime: string = (Number(await localForage.getItem<string>(`${collection.id}-time`)) - 1).toString();
             const sinceTime: string = (Number(await localForage.getItem<string>(`${collection.id}-time`)) - 1).toString();
-            const file: file[] = await getFiles([collection], sinceTime, "100", token);
+            const files: file[] = await getFiles([collection], sinceTime, "1", token) || [];
+
             return {
             return {
-                file: file[0],
+                file: files[0],
                 collection,
                 collection,
             }
             }
         }))
         }))