corrected collection sorting

This commit is contained in:
Abhinav-grd 2021-02-16 18:11:27 +05:30
parent c0c8684125
commit 92c33e9acc

View file

@ -153,7 +153,7 @@ export const syncCollections = async (token: string, key: string) => {
updationTime = Math.max(updationTime, collection.updationTime); updationTime = Math.max(updationTime, collection.updationTime);
} }
} }
collections.sort((a, b) => a.updationTime - b.updationTime); collections.sort((a, b) => b.updationTime - a.updationTime);
await localForage.setItem(COLLECTION_UPDATION_TIME, updationTime); await localForage.setItem(COLLECTION_UPDATION_TIME, updationTime);
await localForage.setItem(COLLECTIONS, collections); await localForage.setItem(COLLECTIONS, collections);
return collections; return collections;