reduce requested file count to 1 in getCollectionLatestFile

This commit is contained in:
Abhinav-grd 2021-01-26 15:20:34 +05:30
parent 6321874ead
commit bc709d5961

View file

@ -115,9 +115,10 @@ export const getCollectionLatestFile = async (
return Promise.all(
collections.map(async collection => {
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 {
file: file[0],
file: files[0],
collection,
}
}))