diff --git a/src/pages/gallery/index.tsx b/src/pages/gallery/index.tsx index 6d3e19a18..af74ea3e6 100644 --- a/src/pages/gallery/index.tsx +++ b/src/pages/gallery/index.tsx @@ -23,7 +23,6 @@ import { getFavItemIds, getLocalCollections, getNonEmptyCollections, - setLocalCollection, } from 'services/collectionService'; import constants from 'utils/strings/constants'; import billingService from 'services/billingService'; @@ -295,7 +294,6 @@ export default function Gallery() { collectionFilesCount.set(id, files.length); } setCollections(nonEmptyCollections); - setLocalCollection(nonEmptyCollections); setCollectionsAndTheirLatestFile(collectionsAndTheirLatestFile); setCollectionFilesCount(collectionFilesCount); const favItemIds = await getFavItemIds(files); diff --git a/src/services/collectionService.ts b/src/services/collectionService.ts index a5ca51f46..ea6b69ee9 100644 --- a/src/services/collectionService.ts +++ b/src/services/collectionService.ts @@ -198,8 +198,8 @@ export const syncCollections = async () => { } collections.sort((a, b) => b.updationTime - a.updationTime); collections.sort((a, b) => (b.type === CollectionType.favorites ? 1 : 0)); - await localForage.setItem(COLLECTION_UPDATION_TIME, updationTime); await localForage.setItem(COLLECTIONS, collections); + await localForage.setItem(COLLECTION_UPDATION_TIME, updationTime); return collections; };